Built motion from commit (unavailable).|2.4.3
[motion2.git] / server / api / cmCustomField / cmCustomField.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 _0x352c=['./cmCustomField.attributes','exports','define','CmCustomField','get','TEXT','transaction','type','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xed95eb,_0x2132e1){var _0x292cd7=function(_0x219f9c){while(--_0x219f9c){_0xed95eb['push'](_0xed95eb['shift']());}};_0x292cd7(++_0x2132e1);}(_0x352c,0x1a1));var _0xc352=function(_0x2ec53e,_0x59038e){_0x2ec53e=_0x2ec53e-0x0;var _0x3a42d0=_0x352c[_0x2ec53e];return _0x3a42d0;};'use strict';var _=require(_0xc352('0x0'));var util=require(_0xc352('0x1'));var logger=require(_0xc352('0x2'))('api');var moment=require(_0xc352('0x3'));var BPromise=require(_0xc352('0x4'));var rp=require(_0xc352('0x5'));var fs=require('fs');var path=require(_0xc352('0x6'));var rimraf=require(_0xc352('0x7'));var config=require('../../config/environment');var attributes=require(_0xc352('0x8'));module[_0xc352('0x9')]=function(_0x1d2777,_0x3775aa){return _0x1d2777[_0xc352('0xa')](_0xc352('0xb'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21a104,_0x4a950f,_0x885875){var _0xc31f6a=_0x21a104[_0xc352('0xc')]({'plain':!![]});var _0x4cda7c={'type':_0x3775aa[_0xc352('0xd')],'transaction':_0x4a950f[_0xc352('0xe')]};switch(_0xc31f6a[_0xc352('0xf')]){case _0xc352('0x10'):_0x4cda7c[_0xc352('0xf')]=_0x3775aa['TEXT'];break;case _0xc352('0x11'):_0x4cda7c[_0xc352('0xf')]=_0x3775aa[_0xc352('0x12')];break;case'switch':_0x4cda7c[_0xc352('0xf')]=_0x3775aa[_0xc352('0x13')];_0x4cda7c[_0xc352('0x14')]=![];break;}_0x1d2777[_0xc352('0x15')][_0xc352('0x16')]('cm_contacts',util[_0xc352('0x17')](_0xc352('0x18'),_0xc31f6a['id']),_0x4cda7c);_0x885875();}}});};