Built motion from commit (unavailable).|2.5.26
[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 _0x3715=['../../config/environment','./userProfile.attributes','exports','define','user_profiles','update','privacyEnabled','then','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x308b18,_0x14d693){var _0x4378b4=function(_0x4f4950){while(--_0x4f4950){_0x308b18['push'](_0x308b18['shift']());}};_0x4378b4(++_0x14d693);}(_0x3715,0xc3));var _0x5371=function(_0x3d57b3,_0x350ae7){_0x3d57b3=_0x3d57b3-0x0;var _0x262944=_0x3715[_0x3d57b3];return _0x262944;};'use strict';var _=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var logger=require(_0x5371('0x2'))(_0x5371('0x3'));var moment=require(_0x5371('0x4'));var BPromise=require(_0x5371('0x5'));var rp=require(_0x5371('0x6'));var fs=require('fs');var path=require(_0x5371('0x7'));var rimraf=require(_0x5371('0x8'));var config=require(_0x5371('0x9'));var attributes=require(_0x5371('0xa'));module[_0x5371('0xb')]=function(_0x50a759,_0x1ffdcb){return _0x50a759[_0x5371('0xc')]('UserProfile',attributes,{'tableName':_0x5371('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x16c64a,_0x41d142,_0x56debd){var _0xdbc695=_0x50a759['models'];_0xdbc695['User'][_0x5371('0xe')]({'privacyEnabled':_0x16c64a[_0x5371('0xf')]},{'where':{'UserProfileId':_0x16c64a['id']}})[_0x5371('0x10')](function(){_0x56debd();})['catch'](function(_0x2e27a5){_0x56debd(_0x2e27a5);});}}});};