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 _0xaf93=['production','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','changed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0xaf93,0x151));var _0x3af9=function(_0x5394bb,_0x3727d2){_0x5394bb=_0x5394bb-0x0;var _0x501ffa=_0xaf93[_0x5394bb];return _0x501ffa;};'use strict';var _=require(_0x3af9('0x0'));var util=require(_0x3af9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3af9('0x2'));var BPromise=require(_0x3af9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3af9('0x4'));var rimraf=require(_0x3af9('0x5'));var config=require(_0x3af9('0x6'));var attributes=require(_0x3af9('0x7'));module[_0x3af9('0x8')]=function(_0x1ad446,_0x333abb){return _0x1ad446['define'](_0x3af9('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x133672,_0x53b5ba,_0x5325b1){if(_0x133672[_0x3af9('0xa')]('preproduction')){_0x133672['savedAt']=moment()[_0x3af9('0xb')](_0x3af9('0xc'));}if(_0x133672[_0x3af9('0xa')](_0x3af9('0xd'))){_0x133672['publishedAt']=moment()[_0x3af9('0xb')](_0x3af9('0xc'));}_0x5325b1(null,_0x133672);}}});};