Built motion from commit (unavailable).|2.5.24
[motion2.git] / server / api / userProfile / userProfile.model.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x84a0=['api','bluebird','request-promise','../../config/environment','./userProfile.attributes','define','UserProfile','user_profiles','models','User','then','catch','lodash','util','../../config/logger'];(function(_0x44441e,_0x3b8c46){var _0x227343=function(_0x2b4f7b){while(--_0x2b4f7b){_0x44441e['push'](_0x44441e['shift']());}};_0x227343(++_0x3b8c46);}(_0x84a0,0x66));var _0x084a=function(_0x1ab35d,_0x3f401d){_0x1ab35d=_0x1ab35d-0x0;var _0x133d6d=_0x84a0[_0x1ab35d];return _0x133d6d;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var logger=require(_0x084a('0x2'))(_0x084a('0x3'));var moment=require('moment');var BPromise=require(_0x084a('0x4'));var rp=require(_0x084a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x084a('0x6'));var attributes=require(_0x084a('0x7'));module['exports']=function(_0x16f8a7,_0x4325ce){return _0x16f8a7[_0x084a('0x8')](_0x084a('0x9'),attributes,{'tableName':_0x084a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x58d419,_0x1051a9,_0x13415d){var _0x8198ad=_0x16f8a7[_0x084a('0xb')];_0x8198ad[_0x084a('0xc')]['update']({'privacyEnabled':_0x58d419['privacyEnabled']},{'where':{'UserProfileId':_0x58d419['id']}})[_0x084a('0xd')](function(){_0x13415d();})[_0x084a('0xe')](function(_0xa63093){_0x13415d(_0xa63093);});}}});};