Commit d3f08c52 authored by Benjamin Bouvier's avatar Benjamin Bouvier
Browse files

Build;

parent e02ce883
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{320:function(t,e,r){"use strict";r.r(e),r.d(e,"Headers",(function(){return u})),r.d(e,"Request",(function(){return b})),r.d(e,"Response",(function(){return w})),r.d(e,"DOMException",(function(){return A})),r.d(e,"fetch",(function(){return _}));var o={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(o.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function c(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function l(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=l(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(c)}),this.text=function(){var t,e,r,o=f(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=d(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(t,e){t=s(t),e=a(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},u.prototype.delete=function(t){delete this.map[s(t)]},u.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},u.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},u.prototype.set=function(t,e){this.map[s(t)]=a(e)},u.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},u.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},u.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},u.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},o.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,o,n=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new u(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new u(e.headers)),this.method=(r=e.method||this.method||"GET",o=r.toUpperCase(),p.indexOf(o)>-1?o:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},y.call(b.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var v=[301,302,303,307,308];w.redirect=function(t,e){if(-1===v.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})};var A=self.DOMException;try{new A}catch(t){(A=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),A.prototype.constructor=A}function _(t,e){return new Promise((function(r,n){var i=new b(t,e);if(i.signal&&i.signal.aborted)return n(new A("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),o=r.shift().trim();if(o){var n=r.join(":").trim();e.append(o,n)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var n="response"in s?s.response:s.responseText;r(new w(n,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new A("Aborted","AbortError"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),i.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),i.signal&&(i.signal.addEventListener("abort",a),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",a)}),s.send(void 0===i._bodyInit?null:i._bodyInit)}))}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=u,self.Request=b,self.Response=w)}}]);
\ No newline at end of file
......@@ -36,7 +36,9 @@
</head>
<body>
<div id="app">
<span class="spinner"></span>
<svg class="spinner" width="11em" height="11em" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>
</svg>
</div>
<div id="postload"></div>
<script src="main.js"></script>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=729)}({729:function(e,t,r){}});
\ No newline at end of file
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=810)}({810:function(e,t,r){}});
\ No newline at end of file
@font-face{font-family:Open Sans;font-style:normal;font-weight:300;src:local("Open Sans Light"),local("OpenSans-Light"),url(assets/fonts/OpenSans-Light-963eb32907744d9a.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;src:local("Open Sans"),local("OpenSans"),url(assets/fonts/OpenSans-Regular-ac327c4db6284ef6.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:600;src:local("Open Sans Semi Bold"),local("OpenSans-Semibold"),url(assets/fonts/OpenSans-Semibold-9f2144213fad53d4.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:700;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(assets/fonts/OpenSans-Bold-892667349c5cff6f.woff) format("woff")}body{line-height:1.42857143;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif}.fa-spinner{animation:spin-animation 1.4s linear infinite}.fa-calculator.enabled,.fa-power-off.enabled{color:#00a651}.fa-star,.fa-star-o:hover{color:#ffd66a}.fa-star-o:hover:before{content:"\f005"}.fa.status.fail{color:red}input,select,textarea{color:#555;background-color:#fff;border:1px solid #cfd9db;border-radius:4px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;box-shadow:none;text-transform:none}input:disabled,select:disabled,textarea:disabled{background-color:#ccc;cursor:not-allowed}.Select__control.Select__control--is-focused,input:focus,select:focus,textarea:focus{border:1px solid #66afe9;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}input[type=file],input[type=file]:focus{border:none;background-color:transparent;color:inherit;box-shadow:none}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAA70lEQVRo3u3Y0Q2DMAxFUY/EKIzgDTpCR/FIHYERyAbtD5VQBSEhTvKg70p8BvmgAAIRxhhjjDHGwBtE5LUcI9Bc42quIQczi8h7dSgARn9mmlNQWxgElO7MFEXFMD1RejDTLmo6WNgDpYkzTVuLQ+LiVijNmCeUnqA2ym0WBJT7DLknfDhinrUuaC7KHDBWe3e0RFmrrd4CZa3v25oo6/UQqoGy3k9UT5QJyDvPAwWD8UDBYUpQsJizKGhMTVT3r2O9E8YTBYPxQMFhSlCwmDMoeEwO6jKYFNTlMDHUZTHfxuU3UxCs/+SMMcYY+7s+Kon/MjmZtXEAAAAASUVORK5CYII=");background-repeat:no-repeat;background-position:right 1ex center;background-size:1em 1em;padding-right:calc(1em + 2ex);text-overflow:ellipsis}.Select__control,.Select__menu{color:#555}.Select__control{border:1px solid #cfd9db;background-color:#fff}.valid-date input,div.Select.valid-fuzzy>div.Select__control:not(.Select__control--is-focused),input.check-validity:valid,select.check-validity:valid{border:1px solid #00a651}.invalid-date input,div.Select.invalid-fuzzy div.Select__control:not(.Select__control--is-focused),input.check-validity:invalid,select.check-validity:invalid{border:1px solid #d75353}#loading-overlay{background-color:#3d424c}#loading-overlay>.loading-message{background-color:#fff}#loading-overlay>.loading-message h3{background-color:#f1f1f1;color:#777}.error-reporter{background-color:#fff;color:#444}.error-reporter pre{border-radius:1px;border-color:#2f2f2f;background-color:#444;color:#fff}header{background-color:#303641;color:#fff}header h1{font-weight:700}header h1,header h1 a,header h1 a:focus,header h1 a:hover{color:#fff}#overlay .settings-dropdown-menu{color:#444;background-color:#fff;border-radius:3px;border:1px solid silver;box-shadow:0 1px 3px 0 rgba(50,54,63,.2),0 6px 18px 0 rgba(50,54,63,.2)}#overlay .settings-dropdown-menu>ul+ul{border-top:1px solid silver}#overlay .settings-dropdown-menu li a:focus,#overlay .settings-dropdown-menu li a:hover{background-color:#f5f6f7}main nav .bank-details .icon{border-radius:5%;border:3px solid #fff}main nav .bank-details .bank-name{color:#fff}main nav .bank-details .bank-name button{color:inherit;text-align:left}main nav .bank-details>li.active .bank-name,main nav .bank-details>li .bank-name button:focus,main nav .bank-details>li .bank-name button:hover{font-weight:700}main nav .bank-details .bank-name .bank-sum{color:#afb0b3}main nav .bank-details>li{border-left:4px solid grey;color:#494f59}main nav .bank-details>li.active{border-color:#d0e9c6}main nav .bank-details a{color:#fff}main nav .bank-details .amount.positive{color:#00a651}main nav .bank-details .amount.negative{color:#f26c4f}main nav .bank-details>li>.accounts>li>a:focus,main nav .bank-details>li>.accounts>li>a:hover{border-left:4px solid #82d8ac;background-color:hsla(0,0%,100%,.25);color:#fff}main nav .bank-details>li>.accounts>li a.active{border-left:4px solid #00a651;color:#fff}main nav .bank-details>li>.accounts>li a{color:#afb0b3;border-left:4px solid transparent}main nav .sidebar-section-list li span.badge{background-color:#fff;color:#2b303a}.sidebar-section-list li{border-bottom:2px solid #343a45;background:#303641}.sidebar-section-list li>a{color:#afb0b3}.sidebar-section-list li>a:focus,.sidebar-section-list li>a:hover{background-color:hsla(0,0%,100%,.25);color:#fff}.sidebar-section-list li>a.active{background:#2b303a;color:#fff}.sidebar-about{text-align:right;color:#fff;padding:0 .75em}.sidebar-about a{color:inherit;font-weight:700}.sidebar-about a:hover{font-style:italic}.ReactModal__Overlay{background-color:rgba(0,0,0,.65)!important}.wizard{background-color:#fff}.wizard header{background-color:transparent;color:inherit}.wizard header h1{color:inherit}.init-panes>a{border-color:#c5c5c5;border-radius:2px;color:#444}.init-panes>a:focus,.init-panes>a:hover{box-shadow:5px 10px 5px #ccc,-5px 10px 5px #ccc}.init-panes>a>p:last-child{color:#fff;text-transform:uppercase}.init-panes .add-first-access-pane-button{background-color:#00a651}.init-panes .import-pane-button{background-color:#0072bc}.init-panes .demo-pane-button{background-color:#dbae34}.operation-wells .well{color:#fff;border:none;background-image:none;background-color:transparent}.operation-wells .well-icon{border-radius:100%;background-color:hsla(0,0%,100%,.2)}.operation-wells .well-sub,.operation-wells .well-title{color:#eee}.operation-wells .well.amount-well-balance{background-color:var(--wells-balance-color)}.operation-wells .well.amount-well-received{background-color:var(--wells-received-color)}.operation-wells .well.amount-well-spent{background-color:var(--wells-spent-color)}.operation-wells .well.amount-well-saved{background-color:var(--wells-saved-color)}.operation-toolbar{border-color:#cfd9db;border-radius:3px}.operation-toolbar ul{background-color:#f1f1f1}.operation-toolbar>form{border-top-color:#cfd9db}.operation-table caption{color:#777}.operation-table>tbody>tr{border-right-color:#eaeaea}.operation-table td.modale-button>button{color:#337ab7}.category-color .rc-color-picker-panel-inner{background-color:#fff}.duplicate{border:1px solid #ddd}.duplicate>div:first-child{border-bottom:1px solid #ddd}.duplicate>div.duplicate-operation>div>h3{font-weight:bolder}.duplicate span.label{font-weight:700}.support-about li{border:1px solid #337ab7;color:#2e2e2e}.support-about li span.label{background-color:#337ab7;color:#fff}body{color:#717171;background:#3d424c}a,a:focus,a:hover{color:#337ab7;text-decoration:none;outline:0}#content{background:#fff}main nav{background-color:#2b303a;color:#fff}.foldable-panel{border-radius:3px;border-color:#cfd9db;box-shadow:0 1px 1px rgba(0,0,0,.05);background-color:#fff}.foldable-panel>h3{background-color:#f1f1f1;color:#777}.foldable-panel>.foldable-panel-body{border-top-color:inherit}
\ No newline at end of file
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=730)}({730:function(e,t,r){}});
\ No newline at end of file
@font-face{font-family:Open Sans;font-style:normal;font-weight:300;src:local("Open Sans Light"),local("OpenSans-Light"),url(assets/fonts/OpenSans-Light-963eb32907744d9a.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;src:local("Open Sans"),local("OpenSans"),url(assets/fonts/OpenSans-Regular-ac327c4db6284ef6.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:600;src:local("Open Sans Semi Bold"),local("OpenSans-Semibold"),url(assets/fonts/OpenSans-Semibold-9f2144213fad53d4.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:700;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(assets/fonts/OpenSans-Bold-892667349c5cff6f.woff) format("woff")}body{line-height:1.42857143;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif}.fa-spinner{animation:spin-animation 1.4s linear infinite}.fa-calculator.enabled,.fa-power-off.enabled{color:#00a651}.fa-star,.fa-star-o:hover{color:#ffd66a}.fa-star-o:hover:before{content:"\f005"}.fa.status.fail{color:red}input,select,textarea{color:#555;background-color:#fff;border:1px solid #cfd9db;border-radius:4px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;box-shadow:none;text-transform:none}input:disabled,select:disabled,textarea:disabled{background-color:#ccc;cursor:not-allowed}.Select__control.Select__control--is-focused,input:focus,select:focus,textarea:focus{border:1px solid #66afe9;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}input[type=file],input[type=file]:focus{border:none;background-color:transparent;color:inherit;box-shadow:none}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAA70lEQVRo3u3Y0Q2DMAxFUY/EKIzgDTpCR/FIHYERyAbtD5VQBSEhTvKg70p8BvmgAAIRxhhjjDHGwBtE5LUcI9Bc42quIQczi8h7dSgARn9mmlNQWxgElO7MFEXFMD1RejDTLmo6WNgDpYkzTVuLQ+LiVijNmCeUnqA2ym0WBJT7DLknfDhinrUuaC7KHDBWe3e0RFmrrd4CZa3v25oo6/UQqoGy3k9UT5QJyDvPAwWD8UDBYUpQsJizKGhMTVT3r2O9E8YTBYPxQMFhSlCwmDMoeEwO6jKYFNTlMDHUZTHfxuU3UxCs/+SMMcYY+7s+Kon/MjmZtXEAAAAASUVORK5CYII=");background-repeat:no-repeat;background-position:right 1ex center;background-size:1em 1em;padding-right:calc(1em + 2ex);text-overflow:ellipsis}.Select__control,.Select__menu{color:#555}.Select__control{border:1px solid #cfd9db;background-color:#fff}.valid-date input,div.Select.valid-fuzzy>div.Select__control:not(.Select__control--is-focused),input.check-validity:valid,select.check-validity:valid{border:1px solid #00a651}.invalid-date input,div.Select.invalid-fuzzy div.Select__control:not(.Select__control--is-focused),input.check-validity:invalid,select.check-validity:invalid{border:1px solid #d75353}#loading-overlay{background-color:#3d424c}#loading-overlay>.loading-message{background-color:#fff}#loading-overlay>.loading-message h3{background-color:#f1f1f1;color:#777}.error-reporter{background-color:#fff;color:#444}.error-reporter pre{border-radius:1px;border-color:#2f2f2f;background-color:#444;color:#fff}header{background-color:#303641;color:#fff}header h1{font-weight:700}header h1,header h1 a,header h1 a:focus,header h1 a:hover{color:#fff}#overlay .settings-dropdown-menu{color:#444;background-color:#fff;border-radius:3px;border:1px solid silver;box-shadow:0 1px 3px 0 rgba(50,54,63,.2),0 6px 18px 0 rgba(50,54,63,.2)}#overlay .settings-dropdown-menu>ul+ul{border-top:1px solid silver}#overlay .settings-dropdown-menu li a:focus,#overlay .settings-dropdown-menu li a:hover{background-color:#f5f6f7}.sidebar-about{text-align:right;color:#fff;padding:0 .75em}.sidebar-about a{color:inherit;font-weight:700}.sidebar-about a:hover{font-style:italic}.ReactModal__Overlay{background-color:rgba(0,0,0,.65)!important}.wizard{background-color:#fff}.wizard header{background-color:transparent;color:inherit}.wizard header h1{color:inherit}.init-panes>a{border-color:#c5c5c5;border-radius:2px;color:#444}.init-panes>a:focus,.init-panes>a:hover{box-shadow:5px 10px 5px #ccc,-5px 10px 5px #ccc}.init-panes>a>p:last-child{color:#fff;text-transform:uppercase}.init-panes .add-first-access-pane-button{background-color:#00a651}.init-panes .import-pane-button{background-color:#0072bc}.init-panes .demo-pane-button{background-color:#dbae34}.category-color .rc-color-picker-panel-inner{background-color:#fff}.duplicate{border:1px solid #ddd}.duplicate>div:first-child{border-bottom:1px solid #ddd}.duplicate>div.duplicate-operation>div>h3{font-weight:bolder}.duplicate span.label{font-weight:700}.support-about li{border:1px solid #337ab7;color:#2e2e2e}.support-about li span.label{background-color:#337ab7;color:#fff}body{color:#717171;background:#3d424c}a,a:focus,a:hover{color:#337ab7;text-decoration:none;outline:0}header{background-color:#494f59}#content{background:#fff}main nav{background-color:#f5f6f7;border-right:1px solid #d6d8da;color:#444}table caption{background-color:transparent}main nav .sidebar-section-list li span.badge{background-color:#494c59;color:#e4e4e4}.alerts{background-image:none!important}main nav .bank-details .icon{height:48px;width:48px;border-radius:0;border:2px solid #cbcbcb;margin-left:0}main nav .bank-details .bank-name{color:inherit;width:calc(100% - 58px)}main nav .bank-details .bank-name button{color:inherit;text-align:left}main nav .bank-details .bank-name .bank-sum{color:#898a8e}main nav .bank-details>li{border:none}main nav .bank-details>li.active .bank-name,main nav .bank-details>li .bank-name button:focus,main nav .bank-details>li .bank-name button:hover{color:#6792d8}main nav .bank-details>li.active .bank-name button:focus,main nav .bank-details>li.active .bank-name button:hover{color:#444}main nav .bank-details>li>.accounts{margin-left:0}main nav .bank-details>li>.accounts>li{margin-bottom:1px}main nav .bank-details a{color:inherit}main nav .bank-details .amount.positive{color:#0d59d2}main nav .bank-details .amount.negative{color:#f26c4f}main nav .bank-details>li>.accounts>li a{border-left:4px solid #cecece;color:inherit}main nav .bank-details>li>.accounts>li a:focus,main nav .bank-details>li>.accounts>li a:hover{border-left-color:#6792d8;background-color:#e4e4e4}main nav .bank-details>li>.accounts>li a.active{background-color:#6792d8;border-left-color:transparent;color:#fff}main nav .bank-details>li>.accounts>li a.active:focus,main nav .bank-details>li>.accounts>li a.active:hover{border-left-color:#5959d4}main nav .bank-details>li>.accounts>li a.active .amount.positive{color:#fff}main nav .bank-details>li>.accounts>li a.active .amount.negative{color:#f5a4a4}.sidebar-section-list{border-top:1px solid #c9cbd0;padding-top:15px}.sidebar-section-list li{color:inherit;padding:0;border:none;background:none;background-color:transparent}.sidebar-section-list li>a{color:#7f8081}.sidebar-section-list li>a:focus,.sidebar-section-list li>a:hover{background-color:#e4e4e4;color:#3e3e3e}.sidebar-section-list li>a.active{background:#e4e4e4;color:#0d59d2;border-top:1px solid #f5f6f7;border-bottom:1px solid #f5f6f7}.sidebar-about{color:#000}.operation-wells .well{border:1px solid;border-radius:0;box-shadow:0 0 5px 1px rgba(0,0,0,.2);position:relative}.operation-wells .well-icon{border-radius:0;background-color:transparent;float:none;margin:0;color:#fff;display:flex;font-size:30px;text-align:center;width:60px;height:100%;position:absolute;top:0;left:0;justify-content:center}@media (max-width:1350px){.operation-wells .well-icon{height:100%}}@media (max-width:620px){.operation-wells .well-icon{background-color:#fff;width:100%;height:auto;position:static}}.operation-wells .well-sub,.operation-wells .well-title{color:inherit}.operation-wells .well.amount-well-balance{color:var(--wells-balance-color);background-color:transparent}.operation-wells .well.amount-well-received{color:var(--wells-received-color);background-color:transparent}.operation-wells .well.amount-well-spent{color:var(--wells-spent-color);background-color:transparent}.operation-wells .well.amount-well-saved{color:var(--wells-saved-color);background-color:transparent}@media (max-width:620px){.operation-wells .well-icon{color:inherit}}@media (min-width:620px){.operation-wells .well.amount-well-balance .well-icon{background-color:var(--wells-balance-color);color:#fff}.operation-wells .well.amount-well-received .well-icon{background-color:var(--wells-received-color);color:#fff}.operation-wells .well.amount-well-spent .well-icon{background-color:var(--wells-spent-color);color:#fff}.operation-wells .well.amount-well-saved .well-icon{background-color:var(--wells-saved-color);color:#fff}}.operation-wells .well-icon *{align-self:center}.operation-toolbar{border-color:#cfd9db;border-radius:3px}.operation-toolbar ul{background-color:transparent}.operation-toolbar>form{border-top-color:#cfd9db}.operation-table{border:0}.operation-table caption{display:none}.operation-table thead th{border-top:none}.operation-table td{vertical-align:middle}.operation-table td,.operation-table th{border-left:0;border-right:0}.operation-table tr:nth-last-child(2) td{border:0}@media (max-width:620px){.operation-table td,.operation-table th{padding-left:5px;padding-right:5px}}.foldable-panel{box-shadow:0 1px 1px rgba(0,0,0,.05);border-color:#cfd9db}.foldable-panel>h3{background-color:transparent}.foldable-panel>.foldable-panel-body{border-top-color:inherit}
\ No newline at end of file
@font-face{font-family:Open Sans;font-style:normal;font-weight:300;src:local("Open Sans Light"),local("OpenSans-Light"),url(assets/fonts/OpenSans-Light-963eb32907744d9a.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;src:local("Open Sans"),local("OpenSans"),url(assets/fonts/OpenSans-Regular-ac327c4db6284ef6.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:600;src:local("Open Sans Semi Bold"),local("OpenSans-Semibold"),url(assets/fonts/OpenSans-Semibold-9f2144213fad53d4.woff) format("woff")}@font-face{font-family:Open Sans;font-style:normal;font-weight:700;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(assets/fonts/OpenSans-Bold-892667349c5cff6f.woff) format("woff")}body{line-height:1.42857143;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif}@keyframes spin-animation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.fa-spinner{animation:spin-animation 1.4s linear infinite}.fa-calculator.enabled{color:#00a651}.fa-star,.fa-star-o:hover{color:#ffd66a}.fa-star-o:hover:before{content:"\f005"}.fa.status.fail{color:red}input,select,textarea{color:#555;background-color:#fff;border:1px solid #cfd9db;border-radius:4px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;box-shadow:none;text-transform:none}input:disabled,select:disabled,textarea:disabled{background-color:#ccc;cursor:not-allowed}.Select__control.Select__control--is-focused,input:focus,select:focus,textarea:focus{border:1px solid #66afe9;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}input[type=checkbox]{-moz-appearance:none;-webkit-appearance:none;appearance:none;cursor:pointer;width:1.15em;height:1.15em;background-color:#fff;border:1px solid #666;border-radius:2px;vertical-align:middle;display:inline-flex;justify-content:flex-start;align-items:center}input[type=checkbox]:checked{color:#fff;background-color:#666}input[type=checkbox]:checked:after{font:normal normal normal 14px/1 FontAwesome,sans-serif;content:"\f00c";margin:auto;font-size:75%}input[type=checkbox].switch{background-color:#555;width:3rem;height:1.5rem;margin-top:.25em;margin-bottom:.25em;border:none;border-radius:1em}input[type=checkbox].switch:after{content:"";margin:0 .15rem;width:1.2rem;height:1.2rem;border-radius:50%;background-color:#fff}input[type=checkbox].switch:checked{background-color:#4fba4f;justify-content:flex-end}label>input[type=checkbox]{vertical-align:middle}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAA70lEQVRo3u3Y0Q2DMAxFUY/EKIzgDTpCR/FIHYERyAbtD5VQBSEhTvKg70p8BvmgAAIRxhhjjDHGwBtE5LUcI9Bc42quIQczi8h7dSgARn9mmlNQWxgElO7MFEXFMD1RejDTLmo6WNgDpYkzTVuLQ+LiVijNmCeUnqA2ym0WBJT7DLknfDhinrUuaC7KHDBWe3e0RFmrrd4CZa3v25oo6/UQqoGy3k9UT5QJyDvPAwWD8UDBYUpQsJizKGhMTVT3r2O9E8YTBYPxQMFhSlCwmDMoeEwO6jKYFNTlMDHUZTHfxuU3UxCs/+SMMcYY+7s+Kon/MjmZtXEAAAAASUVORK5CYII=");background-repeat:no-repeat;background-position:right 1ex center;background-size:1em 1em;padding-right:calc(1em + 2ex);text-overflow:ellipsis}.Select__control,.Select__menu{color:#555}.Select__control{border:1px solid #cfd9db;background-color:#fff}.valid-date input,div.Select.valid-fuzzy>div.Select__control:not(.Select__control--is-focused),input.check-validity:valid,select.check-validity:valid{border:1px solid #00a651}.invalid-date input,div.Select.invalid-fuzzy div.Select__control:not(.Select__control--is-focused),input.check-validity:invalid,select.check-validity:invalid{border:1px solid #d75353}#loading-overlay{background-color:#3d424c}#loading-overlay>.loading-message{background-color:#fff}#loading-overlay>.loading-message h3{background-color:#f1f1f1;color:#777}.error-reporter{background-color:#fff;color:#444}.error-reporter pre{border-radius:1px;border-color:#2f2f2f;background-color:#444;color:#fff}header{background-color:#303641;color:#fff}header h1{font-weight:700}header h1,header h1 a,header h1 a:focus,header h1 a:hover{color:#fff}#overlay .settings-dropdown-menu{color:#444;background-color:#fff;border-radius:3px;border:1px solid silver;box-shadow:0 1px 3px 0 rgba(50,54,63,.2),0 6px 18px 0 rgba(50,54,63,.2)}#overlay .settings-dropdown-menu>ul+ul{border-top:1px solid silver}#overlay .settings-dropdown-menu li a:focus,#overlay .settings-dropdown-menu li a:hover{background-color:#f5f6f7}.sidebar-about{text-align:right;color:#fff;padding:0 .75em}.sidebar-about a{color:inherit;font-weight:700}.sidebar-about a:hover{font-style:italic}main nav .bank-details .icon{height:48px;width:48px;border-radius:0;border:2px solid #cbcbcb;margin-left:0}main nav .bank-details .bank-name{color:inherit;width:calc(100% - 58px)}main nav .bank-details .bank-name button{color:inherit;text-align:left}main nav .bank-details .bank-name .bank-sum{color:#898a8e}main nav .bank-details>li{border:none}main nav .bank-details>li.active .bank-name,main nav .bank-details>li .bank-name button:focus,main nav .bank-details>li .bank-name button:hover{color:#6792d8}main nav .bank-details>li.active .bank-name button:focus,main nav .bank-details>li.active .bank-name button:hover{color:#444}main nav .bank-details>li>.accounts{margin-left:0}main nav .bank-details>li>.accounts>li{margin-bottom:1px}main nav .bank-details a{color:inherit}main nav .bank-details .amount.positive{color:#0d59d2}main nav .bank-details .amount.negative{color:#f26c4f}main nav .bank-details>li>.accounts>li a{border-left:4px solid #cecece;color:inherit}main nav .bank-details>li>.accounts>li a:focus,main nav .bank-details>li>.accounts>li a:hover{border-left-color:#6792d8;background-color:#e4e4e4}main nav .bank-details>li>.accounts>li a.active{background-color:#6792d8;border-left-color:transparent;color:#fff}main nav .bank-details>li>.accounts>li a.active:focus,main nav .bank-details>li>.accounts>li a.active:hover{border-left-color:#5959d4}main nav .bank-details>li>.accounts>li a.active .amount.positive{color:#fff}main nav .bank-details>li>.accounts>li a.active .amount.negative{color:#f5a4a4}.sidebar-section-list{border-top:1px solid #c9cbd0;padding-top:15px}.sidebar-section-list li{color:inherit;padding:0;border:none;background:none;background-color:transparent}.sidebar-section-list li>a{color:#7f8081;border-top:1px solid transparent;border-bottom:1px solid transparent}.sidebar-section-list li>a:focus,.sidebar-section-list li>a:hover{background-color:#e4e4e4;color:#3e3e3e}.sidebar-section-list li>a.active{background:#e4e4e4;color:#0d59d2;border-top:1px solid #f5f6f7;border-bottom:1px solid #f5f6f7}.sidebar-section-list li span.badge{background-color:#494c59;color:#e4e4e4}.sidebar-about{color:#000}.ReactModal__Overlay{background-color:rgba(0,0,0,.65)!important}.onboarding{background-color:#fff}.onboarding header{background-color:transparent;color:inherit}.onboarding header h1{color:inherit}.onboarding header a{text-align:right}.onboarding-panes>a{border-color:#c5c5c5;border-radius:2px;color:#444}.onboarding-panes>a:focus,.onboarding-panes>a:hover{box-shadow:5px 10px 5px #ccc,-5px 10px 5px #ccc}.onboarding-panes>a>p:last-child{color:#fff;text-transform:uppercase}.onboarding-panes .add-first-access-pane-button{background-color:#00a651}.onboarding-panes .import-pane-button{background-color:#0072bc}.onboarding-panes .demo-pane-button{background-color:#dbae34}.category-color .rc-color-picker-panel-inner{background-color:#fff}.dashboard-access{border:1px solid #ddd}#dashboard .accesses-list>li>.dashboard-access-summary{background-color:#ddd}#dashboard .accesses-list>li .bank-summary{color:#444}#dashboard .accesses-list>li .accounts li a:before{font:normal normal normal 14px/1 FontAwesome,sans-serif;content:"\f08e";margin-right:2ex}#dashboard .accesses-list>li .accounts li a,#dashboard .accesses-list>li .accounts li a:visited{color:inherit}#dashboard .accesses-list>li .accounts li a:active:before,#dashboard .accesses-list>li .accounts li a:focus:before,#dashboard .accesses-list>li .accounts li a:hover:before{color:#444}#dashboard .amount.positive{color:#00a651}#dashboard .amount.negative{color:#f26c4f}#dashboard .accesses-list>li .dashboard-access-charts h3{text-align:center}.duplicate{border:1px solid #ddd}.duplicate>div:first-child{border-bottom:1px solid #ddd}.duplicate>div.duplicate-operation>div>h3{font-weight:bolder}.duplicate span.label{font-weight:700}.support-about li{border:1px solid #337ab7;color:#2e2e2e}.support-about li span.label{background-color:#337ab7;color:#fff}.account-summary{color:var(--wells-balance-color);border:1px solid;background-color:transparent;border-radius:0;box-shadow:0 0 5px 1px rgba(0,0,0,.2);position:relative;padding-left:5.5em;text-align:right}.account-summary .icon{margin:0;border-radius:0;background-color:var(--wells-balance-color);color:#fff;display:flex;width:3em;height:100%;position:absolute;top:0;left:0;justify-content:center;align-items:center;font-size:1.5em}.account-summary p.main-balance{font-size:1.5em}.account-summary .date{text-transform:lowercase}.account-summary .amount{font-weight:700}@media (max-width:768px){.account-summary p.main-balance{font-size:1em}.account-summary p.main-balance .amount{font-size:1.5em}}.search-summary li{color:#fff;border-radius:3px;border:1px solid}.search-summary li.received{color:var(--wells-received-color);background-color:transparent}.search-summary li.spent{color:var(--wells-spent-color);background-color:transparent}.search-summary li.saved{color:var(--wells-saved-color);background-color:transparent}@media (max-width:768px){.search-summary li span{text-align:center}}.operation-table{border:0}.operation-table thead th{border-top:none}.operation-table td{vertical-align:middle}.operation-table td,.operation-table th{border-left:0;border-right:0}.operation-table tr:nth-last-child(2) td{border:0}.operation-table td.amount{font-weight:700}.operation-table>tbody>tr.income td.amount{color:#38bd13}@media (max-width:620px){.operation-table td,.operation-table th{padding-left:5px;padding-right:5px}}body{color:#717171;background:#3d424c}a,a:focus,a:hover{color:#337ab7;text-decoration:none;outline:0}header{background-color:#494f59}#content{background:#fff}main nav{background-color:#f5f6f7;border-right:1px solid #d6d8da;color:#444}table caption{background-color:transparent}.alerts{background-image:none!important}
\ No newline at end of file
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=731)}({731:function(e,t,r){}});
\ No newline at end of file
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=809)}({809:function(e,t,r){}});
\ No newline at end of file
{"themes":["dark","default","light"]}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const helpers_1 = require("./helpers");
const models_1 = require("./models");
const log = helpers_1.makeLogger('cli');
async function createUser(login) {
try {
log.info(`Creating user with login ${login}: setting up database.`);
await models_1.setupOrm();
log.info('Database set up; creating user...');
const user = await models_1.User.create({ login });
const id = user.id;
log.info(`User ${login} created with success! id=${id}`);
}
catch (err) {
log.error(`Couldn't create user ${login}: ${err.message}
${err.stack}`);
}
}
exports.createUser = createUser;
This diff is collapsed.
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const models_1 = require("../models");
const accounts_manager_1 = __importDefault(require("../lib/accounts-manager"));
const poller_1 = require("../lib/poller");
const bank_vendors_1 = require("../lib/bank-vendors");
const AccountController = __importStar(require("./accounts"));
const settings_1 = require("./settings");
const helpers_1 = require("../helpers");
const validators_1 = require("../shared/validators");
let log = helpers_1.makeLogger('controllers/accesses');
// Preloads a bank access (sets @access).
async function preloadAccess(req, res, next, accessId) {
try {
let { id: userId } = req.user;
let access = await models_1.Access.find(userId, accessId);
if (!access) {
throw new helpers_1.KError('bank access not found', 404);
}
req.preloaded = { access };
return next();
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when finding bank access');
}
}
exports.preloadAccess = preloadAccess;
async function destroyWithData(userId, access) {
log.info(`Removing access ${access.id} for bank ${access.vendorId}...`);
await models_1.Access.destroy(userId, access.id);
await AccountController.fixupDefaultAccount(userId);
log.info('Done!');
}
exports.destroyWithData = destroyWithData;
// Destroy a given access, including accounts, alerts and operations.
async function destroy(req, res) {
try {
let { user: { id: userId } } = req;
if (await settings_1.isDemoEnabled(userId)) {
throw new helpers_1.KError("access deletion isn't allowed in demo mode", 400);
}
await destroyWithData(userId, req.preloaded.access);
res.status(204).end();
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when destroying an access');
}
}
exports.destroy = destroy;
async function createAndRetrieveData(userId, params) {
let error = validators_1.checkHasAllFields(params, ['vendorId', 'login', 'password']) ||
validators_1.checkAllowedFields(params, ['vendorId', 'login', 'password', 'fields', 'customLabel']);
if (error) {
throw new helpers_1.KError(`when creating a new access: ${error}`, 400);
}
let access = null;
try {
access = await models_1.Access.create(userId, params);
await accounts_manager_1.default.retrieveAndAddAccountsByAccess(userId, access, /* interactive */ true);
let { accounts, newOperations } = await accounts_manager_1.default.retrieveOperationsByAccess(userId, access,
/* ignoreLastFetchDate */ false,
/* isInteractive */ true);
return {
accessId: access.id,
accounts,
newOperations
};
}
catch (err) {
log.error('The access process creation failed, cleaning up...');
// Let sql remove all the dependent data for us.
if (access !== null) {
log.info('\tdeleting access...');
await models_1.Access.destroy(userId, access.id);
}
// Rethrow the error
throw err;
}
}
exports.createAndRetrieveData = createAndRetrieveData;
// Creates a new bank access (expecting at least (vendorId / login /
// password)), and retrieves its accounts and operations.
async function create(req, res) {
try {
let { user: { id: userId } } = req;
if (await settings_1.isDemoEnabled(userId)) {
throw new helpers_1.KError("access creation isn't allowed in demo mode", 400);
}
const data = await createAndRetrieveData(userId, req.body);
res.status(201).json(data);
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when creating a bank access');
}
}
exports.create = create;
// Fetch operations using the backend and return the operations to the client.
async function fetchOperations(req, res) {
try {
let { id: userId } = req.user;
let access = req.preloaded.access;
let bankVendor = bank_vendors_1.bankVendorByUuid(access.vendorId);
if (!access.isEnabled() || bankVendor.deprecated) {
let errcode = helpers_1.getErrorCode('DISABLED_ACCESS');
throw new helpers_1.KError('disabled access', 403, errcode);
}
let { accounts, newOperations } = await accounts_manager_1.default.retrieveOperationsByAccess(userId, access,
/* ignoreLastFetchDate */ false,
/* isInteractive */ true);
res.status(200).json({
accounts,
newOperations
});
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when fetching operations');
}
}
exports.fetchOperations = fetchOperations;
// Fetch accounts, including new accounts, and operations using the backend and
// return both to the client.
async function fetchAccounts(req, res) {
try {
let { id: userId } = req.user;
let access = req.preloaded.access;
let bankVendor = bank_vendors_1.bankVendorByUuid(access.vendorId);
if (!access.isEnabled() || bankVendor.deprecated) {
let errcode = helpers_1.getErrorCode('DISABLED_ACCESS');
throw new helpers_1.KError('disabled access', 403, errcode);
}
await accounts_manager_1.default.retrieveAndAddAccountsByAccess(userId, access, /* interactive */ true);
let { accounts, newOperations } = await accounts_manager_1.default.retrieveOperationsByAccess(userId, access,
/* ignoreLastFetchDate */ true,
/* isInteractive */ true);
res.status(200).json({
accounts,
newOperations
});
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when fetching accounts');
}
}
exports.fetchAccounts = fetchAccounts;
// Fetch all the operations / accounts for all the accesses, as is done during
// any regular poll.
async function poll(req, res) {
try {
let { id: userId } = req.user;
await poller_1.fullPoll(userId);
res.status(200).json({
status: 'OK'
});
}
catch (err) {
log.warn(`Error when doing a full poll: ${err.message}`);
res.status(500).json({
status: 'error',
message: err.message
});
}
}
exports.poll = poll;
// Updates a bank access.
async function update(req, res) {
try {
let { id: userId } = req.user;
let { access } = req.preloaded;
let attrs = req.body;
let error = validators_1.checkAllowedFields(attrs, ['enabled', 'customLabel']);
if (error) {
throw new helpers_1.KError(`when updating an access: ${error}`, 400);
}
if (attrs.enabled === false) {
attrs.password = null;
delete attrs.enabled;
}
if (attrs.customLabel === '') {
attrs.customLabel = null;
}
await models_1.Access.update(userId, access.id, attrs);
res.status(201).json({ status: 'OK' });
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when updating bank access');
}
}
exports.update = update;
async function updateAndFetchAccounts(req, res) {
try {
let { id: userId } = req.user;
let { access } = req.preloaded;
let attrs = req.body;
let error = validators_1.checkAllowedFields(attrs, ['login', 'password', 'fields']);
if (error) {
throw new helpers_1.KError(`when updating and polling an access: ${error}`, 400);
}
if (typeof attrs.fields !== 'undefined') {
let newFields = attrs.fields;
delete attrs.fields;
for (let { name, value } of newFields) {
let previous = access.fields.find(existing => existing.name === name);
if (value === null) {
// Delete the custom field if necessary.
if (typeof previous !== 'undefined') {
await models_1.AccessField.destroy(userId, previous.id);
}
}
else if (typeof previous !== 'undefined') {
// Update the custom field if necessary.
if (previous.value !== value) {
await models_1.AccessField.update(userId, previous.id, { name, value });
}
}
else {
// Create it.
await models_1.AccessField.create(userId, { name, value, accessId: access.id });
}
}
}
// The preloaded access needs to be updated before calling fetchAccounts.
req.preloaded.access = await models_1.Access.update(userId, access.id, attrs);
await fetchAccounts(req, res);
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when updating and fetching bank access');
}
}
exports.updateAndFetchAccounts = updateAndFetchAccounts;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const models_1 = require("../models");
const helpers_1 = require("../helpers");
const validators_1 = require("../shared/validators");
const accounts_manager_1 = __importDefault(require("../lib/accounts-manager"));
const settings_1 = require("./settings");
let log = helpers_1.makeLogger('controllers/accounts');
// Prefills the @account field with a queried bank account.
async function preloadAccount(req, res, next, accountID) {
try {
let { id: userId } = req.user;
let account = await models_1.Account.find(userId, accountID);
if (!account) {
throw new helpers_1.KError('Bank account not found', 404);
}
req.preloaded = { account };
return next();
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when preloading a bank account');
}
}
exports.preloadAccount = preloadAccount;
async function fixupDefaultAccount(userId) {
let found = await models_1.Setting.findOrCreateDefault(userId, 'default-account-id');
if (found && found.value !== '') {
let accountFound = await models_1.Account.find(userId, found.value);
if (!accountFound) {
log.info("-> Removing the default account setting since the account doesn't exist anymore.");
await models_1.Setting.update(userId, found.id, { value: '' });
}
}
}
exports.fixupDefaultAccount = fixupDefaultAccount;
// Destroy an account and all its operations, alerts, and accesses if no other
// accounts are bound to this access.
async function destroyWithOperations(userId, account) {
log.info(`Removing account ${account.label} from database...`);
log.info(`\t-> Destroy account ${account.label}`);
await models_1.Account.destroy(userId, account.id);
await fixupDefaultAccount(userId);
let accounts = await models_1.Account.byAccess(userId, { id: account.accessId });
if (accounts && accounts.length === 0) {
log.info('\t-> No other accounts bound: destroying access.');
await models_1.Access.destroy(userId, account.accessId);
}
}
exports.destroyWithOperations = destroyWithOperations;
async function update(req, res) {
try {
let { id: userId } = req.user;
let newFields = req.body;
let error = validators_1.checkAllowedFields(newFields, ['excludeFromBalance', 'customLabel']);
if (error) {
throw new helpers_1.KError(`when updating an account: ${error}`, 400);
}
let account = req.preloaded.account;
let newAccount = await models_1.Account.update(userId, account.id, newFields);
res.status(200).json(newAccount);
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when updating an account');
}
}
exports.update = update;
// Delete account, operations and alerts.
async function destroy(req, res) {
try {
let { id: userId } = req.user;
if (await settings_1.isDemoEnabled(userId)) {
throw new helpers_1.KError("account deletion isn't allowed in demo mode", 400);
}
await destroyWithOperations(userId, req.preloaded.account);
res.status(204).end();
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when destroying an account');
}
}
exports.destroy = destroy;
async function resyncBalance(req, res) {
try {
let { id: userId } = req.user;
let account = req.preloaded.account;
let updatedAccount = await accounts_manager_1.default.resyncAccountBalance(userId, account,
/* interactive */ true);
res.status(200).json(updatedAccount);
}
catch (err) {
return helpers_1.asyncErr(res, err, 'when getting balance of a bank account');
}
}
exports.resyncBalance = resyncBalance;