Commit 6b0cdfab authored by Benjamin Bouvier's avatar Benjamin Bouvier

Build;

parent add38974
Pipeline #114164 failed with stages
in 13 minutes and 25 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{313: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
This source diff could not be displayed because it is too large. You can view the blob instead.
module.exports = __webpack_public_path__ + "assets/fonts/fontawesome-webfont-912ec66d7572ff82.svg";
\ No newline at end of file
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=711)}({711:function(e,t,r){}});
\ No newline at end of file
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=712)}({712:function(e,t,r){}});
\ No newline at end of file
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=713)}({713:function(e,t,r){}});
\ No newline at end of file
{"themes":["default","light"]}
\ No newline at end of file
{"themes":["dark","default","light"]}
\ No newline at end of file
'use strict';
var _path = require('path');
var _path2 = _interopRequireDefault(_path);
var _ospath = require('ospath');
var _ospath2 = _interopRequireDefault(_ospath);
var _helpers = require('./helpers');
var _logger = require('./lib/logger.js');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
let log = (0, _helpers.makeLogger)('apply-config');
function toBool(x) {
return typeof x === 'string' ? x !== 'false' : !!x;
}
function checkPortOrDefault(maybePort, defaultPort, errorMessage) {
// Use the defaultPort in case maybePort is not set in the config file, in an env variable
// and the config file is not used.
if (maybePort === null || typeof maybePort === 'undefined' || maybePort === '') {
return defaultPort;
}
let port = Number.parseInt(maybePort, 10);
if (Number.isNaN(port) || port <= 0 || port > 65535) {
log.error(`Invalid value for port: ${maybePort}`);
throw new Error(errorMessage);
}
return port;
}
module.exports = function prepareProcessKresus(config) {
// Assume development mode if NODE_ENV isn't set.
if (typeof process.env.NODE_ENV === 'undefined' || process.env.NODE_ENV.length === 0) {
process.env.NODE_ENV = 'development';
}
process.kresus = {};
let dataDir = process.env.KRESUS_DIR || config && config.kresus && config.kresus.datadir || null;
if (!dataDir) {
dataDir = _path2.default.join(_ospath2.default.home(), '.kresus');
}
process.kresus.dataDir = dataDir;
let logFilePath = `${process.kresus.dataDir}/kresus.log`;
if (typeof process.env.KRESUS_LOG_FILE !== 'undefined') {
logFilePath = process.env.KRESUS_LOG_FILE;
} else if (config && config.logs && config.logs.log_file) {
logFilePath = config.logs.log_file;
}
process.kresus.logFilePath = logFilePath;
(0, _logger.setLogFilePath)(process.kresus.logFilePath);
let port = process.env.PORT || config && config.kresus && config.kresus.port;
if (process.env.NODE_ENV === 'development') {
log.warn('In development mode, forcing port to 9876 for webpack-dev-server.');
port = null;
}
process.kresus.port = checkPortOrDefault(port, 9876, 'Invalid Kresus port provided.');
process.kresus.host = process.env.HOST || config && config.kresus && config.kresus.host || '127.0.0.1';
process.kresus.pythonExec = process.env.KRESUS_PYTHON_EXEC || config && config.kresus && config.kresus.python_exec || 'python2';
let urlPrefix = process.env.KRESUS_URL_PREFIX || config && config.kresus && config.kresus.url_prefix || '';
process.kresus.urlPrefix = _path2.default.posix.resolve('/', urlPrefix);
process.kresus.weboobDir = process.env.KRESUS_WEBOOB_DIR || config && config.weboob && config.weboob.srcdir || null;
process.kresus.weboobSourcesList = process.env.KRESUS_WEBOOB_SOURCES_LIST || config && config.weboob && config.weboob.sources_list || null;
process.kresus.emailTransport = process.env.KRESUS_EMAIL_TRANSPORT || config && config.email && config.email.transport || null;
if (process.kresus.emailTransport && process.kresus.emailTransport !== 'smtp' && process.kresus.emailTransport !== 'sendmail') {
throw new Error('Invalid email transport provided.');
}
process.kresus.emailSendmailBin = process.env.KRESUS_EMAIL_SENDMAIL_BIN || config && config.email && config.email.sendmail_bin || null;
process.kresus.emailFrom = process.env.KRESUS_EMAIL_FROM || config && config.email && config.email.from || null;
process.kresus.smtpHost = process.env.KRESUS_EMAIL_HOST || config && config.email && config.email.host || null;
let smtpPort = process.env.KRESUS_EMAIL_PORT || config && config.email && config.email.port;
process.kresus.smtpPort = checkPortOrDefault(smtpPort, null, 'Invalid SMTP port provided.');
process.kresus.smtpUser = process.env.KRESUS_EMAIL_USER || config && config.email && config.email.user || null;
process.kresus.smtpPassword = process.env.KRESUS_EMAIL_PASSWORD || config && config.email && config.email.password || null;
let smtpForceTLS = false;
if (typeof process.env.KRESUS_EMAIL_FORCE_TLS !== 'undefined') {
smtpForceTLS = process.env.KRESUS_EMAIL_FORCE_TLS;
} else if (config && config.email && typeof config.email.force_tls !== 'undefined') {
smtpForceTLS = config.email.force_tls;
}
process.kresus.smtpForceTLS = toBool(smtpForceTLS);
let smtpRejectUnauthorizedTLS = true;
if (typeof process.env.KRESUS_EMAIL_REJECT_UNAUTHORIZED_TLS !== 'undefined') {
smtpRejectUnauthorizedTLS = process.env.KRESUS_EMAIL_REJECT_UNAUTHORIZED_TLS;
} else if (config && config.email && typeof config.email.reject_unauthorized_tls !== 'undefined') {
smtpRejectUnauthorizedTLS = config.email.reject_unauthorized_tls;
}
process.kresus.smtpRejectUnauthorizedTLS = toBool(smtpRejectUnauthorizedTLS);
let displayedPassword = process.kresus.smtpPassword === null ? null : '(hidden)';
log.info(`Running Kresus with the following parameters:
- NODE_ENV = ${process.env.NODE_ENV}
- KRESUS_DIR = ${process.kresus.dataDir}
- HOST = ${process.kresus.host}
- PORT = ${process.kresus.port}
- KRESUS_PYTHON_EXEC = ${process.kresus.pythonExec}
- KRESUS_URL_PREFIX = ${process.kresus.urlPrefix}
- KRESUS_WEBOOB_DIR = ${process.kresus.weboobDir}
- KRESUS_WEBOOB_SOURCES_LIST = ${process.kresus.weboobSourcesList}
- KRESUS_EMAIL_TRANSPORT = ${process.kresus.emailTransport}
- KRESUS_EMAIL_SENDMAIL_BIN = ${process.kresus.emailSendmailBin}
- KRESUS_EMAIL_FROM = ${process.kresus.emailFrom}
- KRESUS_EMAIL_HOST = ${process.kresus.smtpHost}
- KRESUS_EMAIL_PORT = ${process.kresus.smtpPort}
- KRESUS_EMAIL_USER = ${process.kresus.smtpUser}
- KRESUS_EMAIL_PASSWORD = ${displayedPassword}
- KRESUS_EMAIL_FORCE_TLS = ${process.kresus.smtpForceTLS}
- KRESUS_EMAIL_REJECT_UNAUTHORIZED_TLS = ${process.kresus.smtpRejectUnauthorizedTLS}
- KRESUS_LOG_FILE = ${process.kresus.logFilePath}
`);
};
\ No newline at end of file
This diff is collapsed.
'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.getManifest = undefined;
exports.getManifest = getManifest;
exports.default = void 0;
let getManifest = exports.getManifest = (() => {
var _ref = _asyncToGenerator(function* (req, res) {
const iconsDirectory = 'favicon/';
const scope = process.kresus.urlPrefix;
var _settings = _interopRequireDefault(require("../models/settings"));
// Eslint does not like camel_case keys in the JSON
/* eslint-disable */
res.status(200).contentType('application/manifest+json').json({
name: 'Kresus',
short_name: 'Kresus',
description: 'Your personal finances manager',
lang: yield _config2.default.getLocale(),
start_url: scope,
scope,
display: 'fullscreen',
theme_color: '#303641',
icons: [{
src: `${iconsDirectory}favicon-16x16.png`,
sizes: '16x16',
type: 'image/png',
density: 0.75
}, {
src: `${iconsDirectory}favicon-32x32.png`,
sizes: '32x32',
type: 'image/png',
density: 0.75
}, {
src: `${iconsDirectory}favicon-48x48.png`,
sizes: '48x48',
type: 'image/png',
density: 1
}, {
src: `${iconsDirectory}favicon-96x96.png`,
sizes: '96x96',
type: 'image/png',
density: 2
}, {
src: `${iconsDirectory}favicon-144x144.png`,
sizes: '144x144',
type: 'image/png',
density: 3
}, {
src: `${iconsDirectory}favicon-192x192.png`,
sizes: '192x192',
type: 'image/png',
density: 4
}]
});
/* eslint-enable */
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
return function getManifest(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
var _config = require('../models/config');
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
var _config2 = _interopRequireDefault(_config);
function getManifest(_x, _x2) {
return _getManifest.apply(this, arguments);
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getManifest() {
_getManifest = _asyncToGenerator(function* (req, res) {
const iconsDirectory = 'favicon/';
const scope = process.kresus.urlPrefix;
let userId = req.user.id; // Eslint does not like camel_case keys in the JSON
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
/* eslint-disable */
res.status(200).contentType('application/manifest+json').json({
name: 'Kresus',
short_name: 'Kresus',
description: 'Your personal finances manager',
lang: yield _settings.default.getLocale(userId),
start_url: scope,
scope,
display: 'fullscreen',
theme_color: '#303641',
icons: [{
src: `${iconsDirectory}favicon-16x16.png`,
sizes: '16x16',
type: 'image/png',
density: 0.75
}, {
src: `${iconsDirectory}favicon-32x32.png`,
sizes: '32x32',
type: 'image/png',
density: 0.75
}, {
src: `${iconsDirectory}favicon-48x48.png`,
sizes: '48x48',
type: 'image/png',
density: 1
}, {
src: `${iconsDirectory}favicon-96x96.png`,
sizes: '96x96',
type: 'image/png',
density: 2
}, {
src: `${iconsDirectory}favicon-144x144.png`,
sizes: '144x144',
type: 'image/png',
density: 3
}, {
src: `${iconsDirectory}favicon-192x192.png`,
sizes: '192x192',
type: 'image/png',
density: 4
}]
});
/* eslint-enable */
});
return _getManifest.apply(this, arguments);
}
exports.default = {
manifest: {
get: getManifest
}
};
\ No newline at end of file
var _default = {
manifest: {
get: getManifest
}
};
exports.default = _default;
\ No newline at end of file
'use strict';
"use strict";
var _manifest = require('./manifest');
var _manifest = _interopRequireDefault(require("./manifest"));
var _manifest2 = _interopRequireDefault(_manifest);
var _routes = require('./v1/routes');
var _routes2 = _interopRequireDefault(_routes);
var _routes = _interopRequireDefault(require("./v1/routes"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = Object.assign({}, _manifest2.default, _routes2.default);
\ No newline at end of file
module.exports = Object.assign({}, _manifest.default, _routes.default);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.update = exports.destroy = exports.create = exports.loadAlert = undefined;
let loadAlert = exports.loadAlert = (() => {
var _ref = _asyncToGenerator(function* (req, res, next, alertId) {
try {
let alert = yield _alert2.default.find(alertId);
if (!alert) {
throw new _helpers.KError('bank alert not found', 404);
}
req.preloaded = req.preloaded || {};
req.preloaded.alert = alert;
return next();
} catch (err) {
return (0, _helpers.asyncErr)(res, err, 'when preloading alert');
}
});
return function loadAlert(_x, _x2, _x3, _x4) {
return _ref.apply(this, arguments);
};
})();
let create = exports.create = (() => {
var _ref2 = _asyncToGenerator(function* (req, res) {
try {
let newAlert = req.body;
if (!newAlert || typeof newAlert.accountId !== 'string' || typeof newAlert.type !== 'string') {
throw new _helpers.KError('missing parameters', 400);
}
let validationError = (0, _validators.checkAlert)(newAlert);
if (validationError) {
throw new _helpers.KError(validationError, 400);
}
let account = yield _account2.default.find(newAlert.accountId);
if (!account) {
throw new _helpers.KError('bank account not found', 404);
}
let alert = yield _alert2.default.create(newAlert);
res.status(201).json(alert);
} catch (err) {
return (0, _helpers.asyncErr)(res, err, 'when creating an alert');
}
});
return function create(_x5, _x6) {
return _ref2.apply(this, arguments);
};
})();
let destroy = exports.destroy = (() => {
var _ref3 = _asyncToGenerator(function* (req, res) {
try {
yield req.preloaded.alert.destroy();
res.status(204).end();
} catch (err) {
return (0, _helpers.asyncErr)(res, err, 'when deleting a bank alert');
}
});
return function destroy(_x7, _x8) {
return _ref3.apply(this, arguments);
};
})();
let update = exports.update = (() => {
var _ref4 = _asyncToGenerator(function* (req, res) {
try {
let newAlert = req.body;
if (typeof newAlert.type !== 'undefined') {
throw new _helpers.KError("can't update an alert type", 400);
}
newAlert = Object.assign(req.preloaded.alert, newAlert);
let validationError = (0, _validators.checkAlert)(newAlert);
if (validationError) {
throw new _helpers.KError(validationError, 400);
}
newAlert = yield req.preloaded.alert.updateAttributes(req.body);
res.status(200).json(newAlert);
} catch (err) {
return (0, _helpers.asyncErr)(res, err, 'when updating a bank alert');
}
});
return function update(_x9, _x10) {
return _ref4.apply(this, arguments);
};
})();
var _account = require('../../models/account');
var _account2 = _interopRequireDefault(_account);
var _alert = require('../../models/alert');
var _alert2 = _interopRequireDefault(_alert);
var _helpers = require('../../helpers');
var _validators = require('../../shared/validators');
exports.loadAlert = loadAlert;
exports.create = create;
exports.destroy = destroy;
exports.update = update;
var _accounts = _interopRequireDefault(require("../../models/accounts"));
var _alerts = _interopRequireDefault(require("../../models/alerts"));
var _helpers = require("../../helpers");
var _validators = require("../../shared/validators");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
\ No newline at end of file
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
function loadAlert(_x, _x2, _x3, _x4) {
return _loadAlert.apply(this, arguments);
}
function _loadAlert() {
_loadAlert = _asyncToGenerator(function* (req, res, next, alertId) {
try {
let userId = req.user.id;
let alert = yield _alerts.default.find(userId, alertId);
if (!alert) {
throw new _helpers.KError('bank alert not found', 404);
}
req.preloaded = req.preloaded || {};
req.preloaded.alert = alert;
return next();
} catch (err) {
return (0, _helpers.asyncErr)(res, err, 'when preloading alert');
}
});
return _loadAlert.apply(this, arguments);
}
function create(_x5, _x6) {
return _create.apply(this, arguments);
}
function _create() {
_create = _asyncToGenerator(function* (req, res) {
try {
let userId = req.user.id;
let newAlert = req.body;
if (!newAlert || typeof newAlert.accountId !== 'string' || typeof newAlert.type !== 'string') {
throw new _helpers.KError('missing parameters', 400);
}
let validationError = (0, _validators.checkAlert)(newAlert);
if (validationError) {
throw new _helpers.KError(validationError, 400);
}
let account = yield _accounts.default.find(userId, newAlert.accountId);
if (!account) {
throw new _helpers.KError('bank account not found', 404);
}
let alert = yield _alerts.default.create(userId, newAlert);
res.status(201).json(alert);
} catch (err) {
return (0, _helpers.asyncErr)(res, err, 'when creating an alert');
}
});
return _create.apply(this, arguments);
}
function destroy(_x7, _x8) {
return _destroy.apply(this, arguments);
}
function _destroy() {
_destroy = _asyncToGenerator(function* (req, res) {
try {
let userId = req.user.id;
yield _alerts.default.destroy(userId, req.preloaded.alert.id);
res.status(204).end();
} catch (err) {
return (0, _helpers.asyncErr)(res, err, 'when deleting a bank alert');
}
});
return _destroy.apply(this, arguments);
}
function update(_x9, _x10) {
return _update.apply(this, arguments);
}
function _update() {
_update = _asyncToGenerator(function* (req, res) {
try {
let userId = req.user.id;
let alert = req.preloaded.alert;
let newAlert = req.body;
if (