Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / squareProject / squareProject.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 _0x4b08=['path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','util','../../config/logger','api','moment','bluebird'];(function(_0x5b8bbc,_0x4c2fcc){var _0xf8a508=function(_0x2c0b0e){while(--_0x2c0b0e){_0x5b8bbc['push'](_0x5b8bbc['shift']());}};_0xf8a508(++_0x4c2fcc);}(_0x4b08,0x1c3));var _0x84b0=function(_0x1657ef,_0x2ea730){_0x1657ef=_0x1657ef-0x0;var _0x5ed40e=_0x4b08[_0x1657ef];return _0x5ed40e;};'use strict';var _=require('lodash');var util=require(_0x84b0('0x0'));var logger=require(_0x84b0('0x1'))(_0x84b0('0x2'));var moment=require(_0x84b0('0x3'));var BPromise=require(_0x84b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84b0('0x5'));var rimraf=require(_0x84b0('0x6'));var config=require(_0x84b0('0x7'));var attributes=require(_0x84b0('0x8'));module['exports']=function(_0x281395,_0x4b0e4d){return _0x281395[_0x84b0('0x9')](_0x84b0('0xa'),attributes,{'tableName':_0x84b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa4618b,_0x4d58e4,_0x44ea96){if(_0xa4618b['changed'](_0x84b0('0xc'))){_0xa4618b[_0x84b0('0xd')]=moment()['format'](_0x84b0('0xe'));}if(_0xa4618b[_0x84b0('0xf')](_0x84b0('0x10'))){_0xa4618b[_0x84b0('0x11')]=moment()[_0x84b0('0x12')](_0x84b0('0xe'));}_0x44ea96(null,_0xa4618b);}}});};