Built motion from commit 43538d75.|2.5.35
[motion2.git] / server / api / faxQueueReport / faxQueueReport.controller.js
index aa03094..3f31389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeb7=['map','FaxQueueReport','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','then','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','error','stack','name','send','index'];(function(_0x2d9fcc,_0x297ddc){var _0x948b92=function(_0xb08341){while(--_0xb08341){_0x2d9fcc['push'](_0x2d9fcc['shift']());}};_0x948b92(++_0x297ddc);}(_0xfeb7,0x170));var _0x7feb=function(_0x54c9e4,_0x30c33f){_0x54c9e4=_0x54c9e4-0x0;var _0x10a186=_0xfeb7[_0x54c9e4];return _0x10a186;};'use strict';var pdf=require(_0x7feb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7feb('0x1'));var zipdir=require(_0x7feb('0x2'));var jsonpatch=require(_0x7feb('0x3'));var rp=require('request-promise');var moment=require(_0x7feb('0x4'));var BPromise=require(_0x7feb('0x5'));var Mustache=require('mustache');var util=require(_0x7feb('0x6'));var path=require(_0x7feb('0x7'));var sox=require(_0x7feb('0x8'));var csv=require(_0x7feb('0x9'));var ejs=require(_0x7feb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7feb('0xb'));var toCsv=require(_0x7feb('0x9'));var querystring=require(_0x7feb('0xc'));var Papa=require(_0x7feb('0xd'));var Redis=require(_0x7feb('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7feb('0xf'));var utils=require(_0x7feb('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x7feb('0x11'));var db=require(_0x7feb('0x12'))['db'];function respondWithStatusCode(_0x28d5f0,_0x5c3b36){_0x5c3b36=_0x5c3b36||0xcc;return function(_0x1b8d9c){if(_0x1b8d9c){return _0x28d5f0[_0x7feb('0x13')](_0x5c3b36);}return _0x28d5f0['status'](_0x5c3b36)[_0x7feb('0x14')]();};}function respondWithResult(_0x1cca81,_0x4b364a){_0x4b364a=_0x4b364a||0xc8;return function(_0x1e5531){if(_0x1e5531){return _0x1cca81[_0x7feb('0x15')](_0x4b364a)[_0x7feb('0x16')](_0x1e5531);}};}function respondWithFilteredResult(_0x33f550,_0x1a1e38){return function(_0x100a16){if(_0x100a16){var _0x4fd64c=_0x100a16[_0x7feb('0x17')],_0x4e4f71=_0x1a1e38[_0x7feb('0x18')],_0x4b993e=_0x1a1e38[_0x7feb('0x18')]+_0x1a1e38[_0x7feb('0x19')],_0xc5c3f2;if(_0x4b993e>=_0x4fd64c){_0x4b993e=_0x4fd64c;_0xc5c3f2=0xc8;}else{_0xc5c3f2=0xce;}_0x33f550[_0x7feb('0x15')](_0xc5c3f2);return _0x33f550[_0x7feb('0x1a')]('Content-Range',_0x4e4f71+'-'+_0x4b993e+'/'+_0x4fd64c)['json'](_0x100a16);}return null;};}function patchUpdates(_0x36465a){return function(_0x488fab){try{jsonpatch[_0x7feb('0x1b')](_0x488fab,_0x36465a,!![]);}catch(_0x3e0473){return BPromise[_0x7feb('0x1c')](_0x3e0473);}return _0x488fab['save']();};}function saveUpdates(_0x32e8c2,_0x5cc5c5){return function(_0x5891d6){if(_0x5891d6){return _0x5891d6['update'](_0x32e8c2)['then'](function(_0x3c0d58){return _0x3c0d58;});}return null;};}function removeEntity(_0x1394a1,_0x98b29d){return function(_0x4e813e){if(_0x4e813e){return _0x4e813e['destroy']()['then'](function(){_0x1394a1[_0x7feb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6986,_0x110825){return function(_0x262996){if(!_0x262996){_0x4d6986[_0x7feb('0x13')](0x194);}return _0x262996;};}function handleError(_0x15ea94,_0x2a6dc6){_0x2a6dc6=_0x2a6dc6||0x1f4;return function(_0x1238b0){logger[_0x7feb('0x1d')](_0x1238b0[_0x7feb('0x1e')]);if(_0x1238b0[_0x7feb('0x1f')]){delete _0x1238b0[_0x7feb('0x1f')];}_0x15ea94[_0x7feb('0x15')](_0x2a6dc6)[_0x7feb('0x20')](_0x1238b0);};}exports[_0x7feb('0x21')]=function(_0x2f59a0,_0x3bca90){var _0x1a06fa={},_0x51a204={},_0x4b1e69={'count':0x0,'rows':[]};var _0x3a62e3=_[_0x7feb('0x22')](db[_0x7feb('0x23')][_0x7feb('0x24')],function(_0x23c103){return{'name':_0x23c103['fieldName'],'type':_0x23c103[_0x7feb('0x25')]['key']};});_0x51a204['model']=_[_0x7feb('0x22')](_0x3a62e3,_0x7feb('0x1f'));_0x51a204[_0x7feb('0x26')]=_[_0x7feb('0x27')](_0x2f59a0[_0x7feb('0x26')]);_0x51a204[_0x7feb('0x28')]=_[_0x7feb('0x29')](_0x51a204[_0x7feb('0x2a')],_0x51a204[_0x7feb('0x26')]);_0x1a06fa[_0x7feb('0x2b')]=_[_0x7feb('0x29')](_0x51a204[_0x7feb('0x2a')],qs[_0x7feb('0x2c')](_0x2f59a0[_0x7feb('0x26')]['fields']));_0x1a06fa[_0x7feb('0x2b')]=_0x1a06fa[_0x7feb('0x2b')][_0x7feb('0x2d')]?_0x1a06fa[_0x7feb('0x2b')]:_0x51a204[_0x7feb('0x2a')];if(!_0x2f59a0['query'][_0x7feb('0x2e')](_0x7feb('0x2f'))){_0x1a06fa[_0x7feb('0x19')]=qs[_0x7feb('0x19')](_0x2f59a0[_0x7feb('0x26')][_0x7feb('0x19')]);_0x1a06fa[_0x7feb('0x18')]=qs[_0x7feb('0x18')](_0x2f59a0[_0x7feb('0x26')][_0x7feb('0x18')]);}_0x1a06fa['order']=qs[_0x7feb('0x30')](_0x2f59a0[_0x7feb('0x26')][_0x7feb('0x30')]);_0x1a06fa['where']=qs[_0x7feb('0x28')](_['pick'](_0x2f59a0[_0x7feb('0x26')],_0x51a204[_0x7feb('0x28')]),_0x3a62e3);if(_0x2f59a0['query'][_0x7feb('0x31')]){_0x1a06fa['where']=_[_0x7feb('0x32')](_0x1a06fa['where'],{'$or':_[_0x7feb('0x22')](_0x3a62e3,function(_0x4a36e6){if(_0x4a36e6['type']!==_0x7feb('0x33')){var _0x66e0c9={};_0x66e0c9[_0x4a36e6[_0x7feb('0x1f')]]={'$like':'%'+_0x2f59a0['query']['filter']+'%'};return _0x66e0c9;}})});}_0x1a06fa=_[_0x7feb('0x32')]({},_0x1a06fa,_0x2f59a0[_0x7feb('0x34')]);var _0x16647d={'where':_0x1a06fa[_0x7feb('0x35')]};return db[_0x7feb('0x23')][_0x7feb('0x17')](_0x16647d)[_0x7feb('0x36')](function(_0x5a5820){_0x4b1e69[_0x7feb('0x17')]=_0x5a5820;if(_0x2f59a0['query'][_0x7feb('0x37')]){_0x1a06fa['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x7feb('0x38')](_0x1a06fa);})[_0x7feb('0x36')](function(_0x27fdb6){_0x4b1e69[_0x7feb('0x39')]=_0x27fdb6;return _0x4b1e69;})['then'](respondWithFilteredResult(_0x3bca90,_0x1a06fa))['catch'](handleError(_0x3bca90,null));};exports[_0x7feb('0x3a')]=function(_0x4023f7,_0x55b2f6){var _0x324755={'raw':!![],'where':{'id':_0x4023f7[_0x7feb('0x3b')]['id']}},_0x52a8b7={};_0x52a8b7[_0x7feb('0x2a')]=_['keys'](db[_0x7feb('0x23')][_0x7feb('0x24')]);_0x52a8b7['query']=_[_0x7feb('0x27')](_0x4023f7[_0x7feb('0x26')]);_0x52a8b7[_0x7feb('0x28')]=_[_0x7feb('0x29')](_0x52a8b7['model'],_0x52a8b7[_0x7feb('0x26')]);_0x324755[_0x7feb('0x2b')]=_['intersection'](_0x52a8b7[_0x7feb('0x2a')],qs[_0x7feb('0x2c')](_0x4023f7[_0x7feb('0x26')][_0x7feb('0x2c')]));_0x324755['attributes']=_0x324755[_0x7feb('0x2b')][_0x7feb('0x2d')]?_0x324755[_0x7feb('0x2b')]:_0x52a8b7['model'];if(_0x4023f7[_0x7feb('0x26')][_0x7feb('0x37')]){_0x324755[_0x7feb('0x3c')]=[{'all':!![]}];}_0x324755=_[_0x7feb('0x32')]({},_0x324755,_0x4023f7['options']);return db[_0x7feb('0x23')][_0x7feb('0x3d')](_0x324755)[_0x7feb('0x36')](handleEntityNotFound(_0x55b2f6,null))[_0x7feb('0x36')](respondWithResult(_0x55b2f6,null))[_0x7feb('0x3e')](handleError(_0x55b2f6,null));};exports[_0x7feb('0x3f')]=function(_0x658403,_0x41c9f2){return db[_0x7feb('0x23')][_0x7feb('0x3f')](_0x658403['body'],{})['then'](respondWithResult(_0x41c9f2,0xc9))[_0x7feb('0x3e')](handleError(_0x41c9f2,null));};exports['update']=function(_0x3a0e0f,_0x42d292){if(_0x3a0e0f[_0x7feb('0x40')]['id']){delete _0x3a0e0f[_0x7feb('0x40')]['id'];}return db[_0x7feb('0x23')][_0x7feb('0x3d')]({'where':{'id':_0x3a0e0f[_0x7feb('0x3b')]['id']}})['then'](handleEntityNotFound(_0x42d292,null))[_0x7feb('0x36')](saveUpdates(_0x3a0e0f[_0x7feb('0x40')],null))['then'](respondWithResult(_0x42d292,null))['catch'](handleError(_0x42d292,null));};exports[_0x7feb('0x41')]=function(_0x2c2a73,_0x1f2efa){return db[_0x7feb('0x23')][_0x7feb('0x3d')]({'where':{'id':_0x2c2a73['params']['id']}})[_0x7feb('0x36')](handleEntityNotFound(_0x1f2efa,null))['then'](removeEntity(_0x1f2efa,null))[_0x7feb('0x3e')](handleError(_0x1f2efa,null));};exports[_0x7feb('0x42')]=function(_0x3458e5,_0x2118e7){return db[_0x7feb('0x23')][_0x7feb('0x42')]()['then'](respondWithResult(_0x2118e7,null))[_0x7feb('0x3e')](handleError(_0x2118e7,null));};
\ No newline at end of file
+var _0x05b0=['stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','model','length','body','find','destroy','describe','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','end','error'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x05b0,0x188));var _0x005b=function(_0x43a86f,_0x3b4337){_0x43a86f=_0x43a86f-0x0;var _0x3aef8a=_0x05b0[_0x43a86f];return _0x3aef8a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x005b('0x0'));var jsonpatch=require(_0x005b('0x1'));var rp=require('request-promise');var moment=require(_0x005b('0x2'));var BPromise=require(_0x005b('0x3'));var Mustache=require('mustache');var util=require(_0x005b('0x4'));var path=require(_0x005b('0x5'));var sox=require('sox');var csv=require(_0x005b('0x6'));var ejs=require(_0x005b('0x7'));var fs=require('fs');var fs_extra=require(_0x005b('0x8'));var _=require(_0x005b('0x9'));var squel=require(_0x005b('0xa'));var crypto=require(_0x005b('0xb'));var jsforce=require(_0x005b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x005b('0x6'));var querystring=require(_0x005b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x005b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x005b('0xf'))(_0x005b('0x10'));var utils=require('../../config/utils');var config=require(_0x005b('0x11'));var licenseUtil=require(_0x005b('0x12'));var db=require(_0x005b('0x13'))['db'];function respondWithStatusCode(_0x10f9bb,_0xce7212){_0xce7212=_0xce7212||0xcc;return function(_0xe2674e){if(_0xe2674e){return _0x10f9bb[_0x005b('0x14')](_0xce7212);}return _0x10f9bb['status'](_0xce7212)['end']();};}function respondWithResult(_0x52ad9c,_0x309c8f){_0x309c8f=_0x309c8f||0xc8;return function(_0x50b7ce){if(_0x50b7ce){return _0x52ad9c[_0x005b('0x15')](_0x309c8f)['json'](_0x50b7ce);}};}function respondWithFilteredResult(_0x1c8eed,_0x1f7743){return function(_0x2ce01e){if(_0x2ce01e){var _0x1991e8=typeof _0x1f7743[_0x005b('0x16')]==='undefined'&&typeof _0x1f7743[_0x005b('0x17')]===_0x005b('0x18');var _0xf3cf84=_0x2ce01e['count'];var _0x206c0a=_0x1991e8?0x0:_0x1f7743[_0x005b('0x16')];var _0x50a6eb=_0x1991e8?_0x2ce01e[_0x005b('0x19')]:_0x1f7743[_0x005b('0x16')]+_0x1f7743[_0x005b('0x17')];var _0x434874;if(_0x50a6eb>=_0xf3cf84){_0x50a6eb=_0xf3cf84;_0x434874=0xc8;}else{_0x434874=0xce;}_0x1c8eed[_0x005b('0x15')](_0x434874);return _0x1c8eed['set'](_0x005b('0x1a'),_0x206c0a+'-'+_0x50a6eb+'/'+_0xf3cf84)[_0x005b('0x1b')](_0x2ce01e);}return null;};}function patchUpdates(_0x4ae164){return function(_0x24637d){try{jsonpatch[_0x005b('0x1c')](_0x24637d,_0x4ae164,!![]);}catch(_0xd97375){return BPromise['reject'](_0xd97375);}return _0x24637d[_0x005b('0x1d')]();};}function saveUpdates(_0x145c36,_0x319981){return function(_0x3521c9){if(_0x3521c9){return _0x3521c9[_0x005b('0x1e')](_0x145c36)[_0x005b('0x1f')](function(_0x4f632f){return _0x4f632f;});}return null;};}function removeEntity(_0x322229,_0x169428){return function(_0x1fef26){if(_0x1fef26){return _0x1fef26['destroy']()[_0x005b('0x1f')](function(){_0x322229['status'](0xcc)[_0x005b('0x20')]();});}};}function handleEntityNotFound(_0x527294,_0x542fa2){return function(_0x2dc341){if(!_0x2dc341){_0x527294[_0x005b('0x14')](0x194);}return _0x2dc341;};}function handleError(_0x3effd5,_0x267f10){_0x267f10=_0x267f10||0x1f4;return function(_0x6730d4){logger[_0x005b('0x21')](_0x6730d4[_0x005b('0x22')]);if(_0x6730d4[_0x005b('0x23')]){delete _0x6730d4['name'];}_0x3effd5[_0x005b('0x15')](_0x267f10)[_0x005b('0x24')](_0x6730d4);};}exports[_0x005b('0x25')]=function(_0x13e834,_0x2e92d1){var _0x1d8f93={},_0x4775a2={},_0x49561a={'count':0x0,'rows':[]};var _0xaf7c71=_[_0x005b('0x26')](db[_0x005b('0x27')][_0x005b('0x28')],function(_0x545a2b){return{'name':_0x545a2b['fieldName'],'type':_0x545a2b[_0x005b('0x29')][_0x005b('0x2a')]};});_0x4775a2['model']=_['map'](_0xaf7c71,_0x005b('0x23'));_0x4775a2['query']=_[_0x005b('0x2b')](_0x13e834[_0x005b('0x2c')]);_0x4775a2[_0x005b('0x2d')]=_['intersection'](_0x4775a2['model'],_0x4775a2[_0x005b('0x2c')]);_0x1d8f93[_0x005b('0x2e')]=_[_0x005b('0x2f')](_0x4775a2['model'],qs['fields'](_0x13e834[_0x005b('0x2c')][_0x005b('0x30')]));_0x1d8f93['attributes']=_0x1d8f93[_0x005b('0x2e')]['length']?_0x1d8f93[_0x005b('0x2e')]:_0x4775a2['model'];if(!_0x13e834['query'][_0x005b('0x31')](_0x005b('0x32'))){_0x1d8f93[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x13e834[_0x005b('0x2c')]['limit']);_0x1d8f93['offset']=qs[_0x005b('0x16')](_0x13e834[_0x005b('0x2c')][_0x005b('0x16')]);}_0x1d8f93[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x13e834[_0x005b('0x2c')]['sort']);_0x1d8f93[_0x005b('0x35')]=qs[_0x005b('0x2d')](_[_0x005b('0x36')](_0x13e834['query'],_0x4775a2[_0x005b('0x2d')]),_0xaf7c71);if(_0x13e834[_0x005b('0x2c')][_0x005b('0x37')]){_0x1d8f93[_0x005b('0x35')]=_[_0x005b('0x38')](_0x1d8f93[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0xaf7c71,function(_0x9f4d6){if(_0x9f4d6[_0x005b('0x29')]!==_0x005b('0x39')){var _0x4d6064={};_0x4d6064[_0x9f4d6[_0x005b('0x23')]]={'$like':'%'+_0x13e834[_0x005b('0x2c')]['filter']+'%'};return _0x4d6064;}})});}_0x1d8f93=_[_0x005b('0x38')]({},_0x1d8f93,_0x13e834[_0x005b('0x3a')]);var _0x1f29de={'where':_0x1d8f93[_0x005b('0x35')]};return db['FaxQueueReport'][_0x005b('0x19')](_0x1f29de)[_0x005b('0x1f')](function(_0x4b0a10){_0x49561a[_0x005b('0x19')]=_0x4b0a10;if(_0x13e834[_0x005b('0x2c')][_0x005b('0x3b')]){_0x1d8f93[_0x005b('0x3c')]=[{'all':!![]}];}return db[_0x005b('0x27')]['findAll'](_0x1d8f93);})['then'](function(_0x1dfe28){_0x49561a[_0x005b('0x3d')]=_0x1dfe28;return _0x49561a;})[_0x005b('0x1f')](respondWithFilteredResult(_0x2e92d1,_0x1d8f93))[_0x005b('0x3e')](handleError(_0x2e92d1,null));};exports[_0x005b('0x3f')]=function(_0x59fefd,_0x182e3a){var _0x14bd15={'raw':!![],'where':{'id':_0x59fefd[_0x005b('0x40')]['id']}},_0x2bbb8a={};_0x2bbb8a[_0x005b('0x41')]=_[_0x005b('0x2b')](db['FaxQueueReport'][_0x005b('0x28')]);_0x2bbb8a['query']=_[_0x005b('0x2b')](_0x59fefd[_0x005b('0x2c')]);_0x2bbb8a['filters']=_[_0x005b('0x2f')](_0x2bbb8a[_0x005b('0x41')],_0x2bbb8a[_0x005b('0x2c')]);_0x14bd15[_0x005b('0x2e')]=_['intersection'](_0x2bbb8a[_0x005b('0x41')],qs[_0x005b('0x30')](_0x59fefd[_0x005b('0x2c')][_0x005b('0x30')]));_0x14bd15[_0x005b('0x2e')]=_0x14bd15[_0x005b('0x2e')][_0x005b('0x42')]?_0x14bd15[_0x005b('0x2e')]:_0x2bbb8a[_0x005b('0x41')];if(_0x59fefd['query'][_0x005b('0x3b')]){_0x14bd15[_0x005b('0x3c')]=[{'all':!![]}];}_0x14bd15=_[_0x005b('0x38')]({},_0x14bd15,_0x59fefd[_0x005b('0x3a')]);return db[_0x005b('0x27')]['find'](_0x14bd15)[_0x005b('0x1f')](handleEntityNotFound(_0x182e3a,null))[_0x005b('0x1f')](respondWithResult(_0x182e3a,null))[_0x005b('0x3e')](handleError(_0x182e3a,null));};exports['create']=function(_0x10a141,_0x50d178){return db['FaxQueueReport']['create'](_0x10a141['body'],{})[_0x005b('0x1f')](respondWithResult(_0x50d178,0xc9))[_0x005b('0x3e')](handleError(_0x50d178,null));};exports[_0x005b('0x1e')]=function(_0xb1898,_0x4e19cd){if(_0xb1898[_0x005b('0x43')]['id']){delete _0xb1898[_0x005b('0x43')]['id'];}return db['FaxQueueReport'][_0x005b('0x44')]({'where':{'id':_0xb1898[_0x005b('0x40')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x4e19cd,null))[_0x005b('0x1f')](saveUpdates(_0xb1898[_0x005b('0x43')],null))['then'](respondWithResult(_0x4e19cd,null))[_0x005b('0x3e')](handleError(_0x4e19cd,null));};exports[_0x005b('0x45')]=function(_0x2aebe9,_0x11dc21){return db[_0x005b('0x27')][_0x005b('0x44')]({'where':{'id':_0x2aebe9['params']['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x11dc21,null))[_0x005b('0x1f')](removeEntity(_0x11dc21,null))[_0x005b('0x3e')](handleError(_0x11dc21,null));};exports[_0x005b('0x46')]=function(_0x288935,_0x1be7c2){return db['FaxQueueReport'][_0x005b('0x46')]()[_0x005b('0x1f')](respondWithResult(_0x1be7c2,null))['catch'](handleError(_0x1be7c2,null));};
\ No newline at end of file