1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x8418=['./squareProject.attributes','exports','SquareProject','changed','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x5acd3e,_0x4fdf9d){var _0x2a477f=function(_0x4e6a57){while(--_0x4e6a57){_0x5acd3e['push'](_0x5acd3e['shift']());}};_0x2a477f(++_0x4fdf9d);}(_0x8418,0x80));var _0x8841=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x8418[_0x4f8f3b];return _0x4c250c;};'use strict';var _=require(_0x8841('0x0'));var util=require(_0x8841('0x1'));var logger=require(_0x8841('0x2'))('api');var moment=require(_0x8841('0x3'));var BPromise=require(_0x8841('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8841('0x5'));var rimraf=require(_0x8841('0x6'));var config=require('../../config/environment');var attributes=require(_0x8841('0x7'));module[_0x8841('0x8')]=function(_0x1e86c9,_0x31ddb5){return _0x1e86c9['define'](_0x8841('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49f186,_0x3a4789,_0x99c18b){if(_0x49f186[_0x8841('0xa')]('preproduction')){_0x49f186['savedAt']=moment()['format'](_0x8841('0xb'));}if(_0x49f186[_0x8841('0xa')](_0x8841('0xc'))){_0x49f186[_0x8841('0xd')]=moment()[_0x8841('0xe')](_0x8841('0xb'));}_0x99c18b(null,_0x49f186);}}});};