f9a93f9cd733b6ab1fa1b476d6e36ef7c502a255
[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 _0x9d2b=['changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','format','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d2b,0x13f));var _0xb9d2=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x9d2b[_0x308374];return _0x1f71e0;};'use strict';var _=require('lodash');var util=require(_0xb9d2('0x0'));var logger=require(_0xb9d2('0x1'))(_0xb9d2('0x2'));var moment=require(_0xb9d2('0x3'));var BPromise=require(_0xb9d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9d2('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d2('0x6'));var attributes=require(_0xb9d2('0x7'));module['exports']=function(_0x33748a,_0x558ca6){return _0x33748a[_0xb9d2('0x8')](_0xb9d2('0x9'),attributes,{'tableName':_0xb9d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x125651,_0x142536,_0x32912a){if(_0x125651[_0xb9d2('0xb')](_0xb9d2('0xc'))){_0x125651['savedAt']=moment()['format'](_0xb9d2('0xd'));}if(_0x125651[_0xb9d2('0xb')]('production')){_0x125651['publishedAt']=moment()[_0xb9d2('0xe')](_0xb9d2('0xd'));}_0x32912a(null,_0x125651);}}});};