Move documentation

This commit is contained in:
kevinpauer
2022-05-12 10:14:10 +02:00
parent 5d66376c77
commit 5f183de174
130 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,531 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" class="active" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" class="active" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>AuthInterceptor</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="infos">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Helpers/auth.interceptor.ts</code>
</p>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(token: <a href="../injectables/TokenStorageService.html" >TokenStorageService</a>)</code>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">Methods</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b> intercept</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>intercept(req: HttpRequest<any>, next: HttpHandler)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { HTTP_INTERCEPTORS, HttpEvent } from &#x27;@angular/common/http&#x27;;
import { Injectable } from &#x27;@angular/core&#x27;;
import {
HttpInterceptor,
HttpHandler,
HttpRequest,
} from &#x27;@angular/common/http&#x27;;
import { TokenStorageService } from &#x27;../Services/token.service&#x27;;
import { Observable } from &#x27;rxjs&#x27;;
const TOKEN_HEADER_KEY &#x3D; &#x27;Authorization&#x27;;
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
constructor(private token: TokenStorageService) {}
intercept(
req: HttpRequest&lt;any&gt;,
next: HttpHandler
): Observable&lt;HttpEvent&lt;any&gt;&gt; {
let authReq &#x3D; req;
const token &#x3D; this.token.getToken();
if (token !&#x3D; null) {
authReq &#x3D; req.clone({
headers: req.headers.set(TOKEN_HEADER_KEY, &#x27;Bearer &#x27; + token),
});
}
return next.handle(authReq);
}
}
export const authInterceptorProviders &#x3D; [
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
];
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,634 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" class="active" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" class="active" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>AuthService</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="infos">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Services/auth.service.ts</code>
</p>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(http: HttpClient)</code>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">Methods</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b> login</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>login(email: string, password: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to login user</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>email</b>
</div>
<div>
</div>
</li>
<li>
<div>
<b>password</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b> register</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>register(email: string, username: string, password: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to register user</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>email</b>
</div>
<div>
</div>
</li>
<li>
<div>
<b>username</b>
</div>
<div>
</div>
</li>
<li>
<div>
<b>password</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { Injectable } from &#x27;@angular/core&#x27;;
import { HttpClient, HttpHeaders } from &#x27;@angular/common/http&#x27;;
import { Observable } from &#x27;rxjs&#x27;;
const AUTH_API &#x3D; &#x27;https://gruppe1.testsites.info/api/user&#x27;;
const httpOptions &#x3D; {
headers: new HttpHeaders({ &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }),
};
@Injectable({
providedIn: &#x27;root&#x27;,
})
export class AuthService {
constructor(private http: HttpClient) {}
/**
* Function to login user
* @param {string} email
* @param {string} password
* @returns Observable
*/
login(email: string, password: string): Observable&lt;any&gt; {
return this.http.post(AUTH_API + &#x27;/login&#x27;, {
email,
password,
});
}
/**
* Function to register user
* @param {string} email
* @param {string} username
* @param {string} password
* @returns Observable
*/
register(email: string, username: string, password: string): Observable&lt;any&gt; {
return this.http.post(
AUTH_API + &#x27;/register&#x27;,
{
email,
password,
username,
},
httpOptions
);
}
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,850 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" class="active" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" class="active" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>BotService</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="infos">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Services/bot.service.ts</code>
</p>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(http: HttpClient, tokenStorage: <a href="../injectables/TokenStorageService.html" >TokenStorageService</a>)</code>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">Methods</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getKeywords</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getKeywords()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get all keywords</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> createKeyword</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>createKeyword(keyword: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to create a keyword</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>keyword</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> deleteKeyword</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>deleteKeyword(keyword: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to delete a keyword</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>keyword</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getSymbols</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getSymbols()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get all shares</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> createShare</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>createShare(isin: string, comment: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to create a share</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>keyword</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> deleteShare</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>deleteShare(symbol: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to delete a share</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>symbol</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { HttpClient, HttpHeaders } from &#x27;@angular/common/http&#x27;;
import { Injectable } from &#x27;@angular/core&#x27;;
import { Observable } from &#x27;rxjs&#x27;;
import { TokenStorageService } from &#x27;./token.service&#x27;;
const API_URL &#x3D; &#x27;https://gruppe1.testsites.info/api/&#x27;;
@Injectable({
providedIn: &#x27;root&#x27;,
})
export class BotService {
constructor(
private http: HttpClient,
private tokenStorage: TokenStorageService
) {}
/**
* Function to get all keywords
* @returns Observable
*/
public getKeywords(): Observable&lt;any&gt; {
return this.http.get(API_URL + &#x27;keywords&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
responseType: &#x27;text&#x27;,
});
}
/**
* Function to create a keyword
* @param {string} keyword
* @returns Observable
*/
public createKeyword(keyword: string): Observable&lt;any&gt; {
return this.http.post(
API_URL + &#x27;keyword&#x27;,
{
keyword,
},
{
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
}
);
}
/**
* Function to delete a keyword
* @param {string} keyword
* @returns Observable
*/
public deleteKeyword(keyword: string): Observable&lt;any&gt; {
return this.http.delete(API_URL + &#x27;keyword&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
body: {
keyword,
},
});
}
/**
* Function to get all shares
* @returns Observable
*/
public getSymbols(): Observable&lt;any&gt; {
return this.http.get(API_URL + &#x27;shares&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
responseType: &#x27;text&#x27;,
});
}
/**
* Function to create a share
* @param {string} keyword
* @returns Observable
*/
public createShare(isin: string, comment: string): Observable&lt;any&gt; {
return this.http.post(
API_URL + &#x27;share&#x27;,
{
comment,
isin,
},
{
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
}
);
}
/**
* Function to delete a share
* @param {string} symbol
* @returns Observable
*/
public deleteShare(symbol: string): Observable&lt;any&gt; {
return this.http.delete(API_URL + &#x27;share&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
body: {
symbol,
},
});
}
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,778 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" class="active" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" class="active" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>DataService</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="infos">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Services/data.service.ts</code>
</p>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(http: HttpClient, tokenStorage: <a href="../injectables/TokenStorageService.html" >TokenStorageService</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>privatehttp</b>
: <code>HttpClient</code>
</div>
<div>
</div>
</li>
<li>
<div>
<b>privatetokenStorage</b>
: <code><a href="../injectables/TokenStorageService.html" target="_self" >TokenStorageService</a></code>
</div>
<div>
</div>
</li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">Methods</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getStockData</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getStockData()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get all portfolio data</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getTransactionData</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getTransactionData()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get all transaction data</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> createTransaction</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>createTransaction(comment: string, isin: string, time: string, count: number, price: number)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to create a transaction</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>symbol</b>
</div>
<div>
</div>
</li>
<li>
<div>
<b>time</b>
: <code>Date</code>
</div>
<div>
</div>
</li>
<li>
<div>
<b>count</b>
</div>
<div>
</div>
</li>
<li>
<div>
<b>price</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getKeywords</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getKeywords()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get all keywords</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { Injectable, OnInit } from &#x27;@angular/core&#x27;;
import { HttpClient, HttpHeaders } from &#x27;@angular/common/http&#x27;;
import { delay, Observable } from &#x27;rxjs&#x27;;
import { TokenStorageService } from &#x27;./token.service&#x27;;
const API_URL &#x3D; &#x27;https://gruppe1.testsites.info/api/&#x27;;
@Injectable({
providedIn: &#x27;root&#x27;,
})
export class DataService {
/**
* @param {HttpClient} privatehttp
* @param {TokenStorageService} privatetokenStorage
*/
constructor(
private http: HttpClient,
private tokenStorage: TokenStorageService
) {}
/**
* Function to get all portfolio data
* @returns Observable
*/
public getStockData(): Observable&lt;any&gt; {
return this.http.get(API_URL + &#x27;portfolio&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
responseType: &#x27;text&#x27;,
});
}
/**
* Function to get all transaction data
* @returns Observable
*/
public getTransactionData(): Observable&lt;any&gt; {
return this.http.get(API_URL + &#x27;transactions&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
responseType: &#x27;text&#x27;,
});
}
/**
* Function to create a transaction
* @param {string} symbol
* @param {Date} time
* @param {number} count
* @param {number} price
* @returns Observable
*/
public createTransaction(
comment: string,
isin: string,
time: string,
count: number,
price: number
): Observable&lt;any&gt; {
time &#x3D; time + &#x27;T12:00:00.000Z&#x27;;
price.toFixed(2);
return this.http.post(
API_URL + &#x27;transaction&#x27;,
{
comment,
count,
isin,
price,
time,
},
{
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
}
);
}
/**
* Function to get all keywords
* @returns Observable
*/
public getKeywords(): Observable&lt;any&gt; {
return this.http.get(API_URL + &#x27;keywords&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
responseType: &#x27;text&#x27;,
});
}
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,632 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" class="active" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" class="active" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>HelperService</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="infos">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Helpers/helper.service.ts</code>
</p>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(botService: <a href="../injectables/BotService.html" >BotService</a>)</code>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">Methods</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b> delay</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>delay(ms: number)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to delay loading of webpage for a smoother user experience</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>ms</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>void</code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b> formatShareData</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>formatShareData()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to format share data</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>Share[]</code>
</div>
<div class="io-description">
<p>Share</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b> formatKeywordsData</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>formatKeywordsData()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>Keyword[]</code>
</div>
<div class="io-description">
<p>Keyword<br>Function to format keyword data</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { Injectable } from &#x27;@angular/core&#x27;;
import { BotService } from &#x27;../Services/bot.service&#x27;;
import { Keyword, Share } from &#x27;../Views/bot-settings/bot-settings.component&#x27;;
@Injectable({
providedIn: &#x27;root&#x27;,
})
export class HelperService {
constructor(private botService: BotService) {}
/**
* Function to delay loading of webpage for a smoother user experience
* @param {number} ms
*/
delay(ms: number) {
return new Promise((resolve) &#x3D;&gt; setTimeout(resolve, ms));
}
/**
* Function to format share data
* @returns Share
*/
formatShareData(): Share[] {
var shares: Share[] &#x3D; [];
this.botService.getSymbols().subscribe((result) &#x3D;&gt; {
var data &#x3D; JSON.parse(result);
for (let i &#x3D; 0; i &lt; data.data.length; i++) {
shares.push({
isin: data.data[i].isin,
});
}
});
return shares;
}
/**
* @returns Keyword
* Function to format keyword data
*/
formatKeywordsData(): Keyword[] {
var keywords: Keyword[] &#x3D; [];
this.botService.getKeywords().subscribe((result) &#x3D;&gt; {
var data &#x3D; JSON.parse(result);
for (let i &#x3D; 0; i &lt; data.data.length; i++) {
keywords.push({
name: data.data[i].keyword,
});
}
});
return keywords;
}
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,750 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" class="active" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" class="active" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>ProfileService</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="infos">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Services/profile.service.ts</code>
</p>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(tokenStorage: <a href="../injectables/TokenStorageService.html" >TokenStorageService</a>, http: HttpClient)</code>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">Methods</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getUserData</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getUserData()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get all Userdata</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> updateProfile</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>updateProfile(username: string, password: number)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to update user profile</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>username</b>
</div>
<div>
</div>
</li>
<li>
<div>
<b>password</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> addTelegramId</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>addTelegramId(telegram_user_id: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to add a telegram id</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>telegramUserID</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> addCronString</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>addCronString(cron: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to add a cron string for automatic updates</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>cronString</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>Observable</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { HttpClient, HttpHeaders } from &#x27;@angular/common/http&#x27;;
import { Injectable } from &#x27;@angular/core&#x27;;
import { Observable } from &#x27;rxjs&#x27;;
import { TokenStorageService } from &#x27;./token.service&#x27;;
const API_URL &#x3D; &#x27;https://gruppe1.testsites.info/api/&#x27;;
@Injectable({
providedIn: &#x27;root&#x27;,
})
export class ProfileService {
constructor(
private tokenStorage: TokenStorageService,
private http: HttpClient
) {}
/**
* Function to get all Userdata
* @returns Observable
*/
public getUserData(): Observable&lt;any&gt; {
return this.http.get(API_URL + &#x27;user&#x27;, {
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
responseType: &#x27;text&#x27;,
});
}
/**
* Function to update user profile
* @param {string} username
* @param {number} password
* @returns Observable
*/
public updateProfile(username: string, password: number): Observable&lt;any&gt; {
return this.http.put(
API_URL + &#x27;user&#x27;,
{
username,
password,
},
{
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
}
);
}
/**
* Function to add a telegram id
* @param {string} telegramUserID
* @returns Observable
*/
public addTelegramId(telegram_user_id: string): Observable&lt;any&gt; {
return this.http.post(
API_URL + &#x27;telegram&#x27;,
{
telegram_user_id,
},
{
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
}
);
}
/**
* Function to add a cron string for automatic updates
* @param {string} cronString
* @returns Observable
*/
public addCronString(cron: string): Observable&lt;any&gt; {
return this.http.put(
&#x27;https://gruppe1.testsites.info/api/user&#x27; + &#x27;/setCron&#x27;,
{
cron,
},
{
headers: new HttpHeaders({
&#x27;Content-Type&#x27;: &#x27;application/json&#x27;,
Authorization: &#x27;Bearer &#x27; + this.tokenStorage.getToken(),
}),
}
);
}
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,728 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" class="active" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" class="active" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
</div>
<div class="content injectable">
<div class="content-data">
<ol class="breadcrumb">
<li>Injectables</li>
<li>TokenStorageService</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="infos">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Services/token.service.ts</code>
</p>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor()</code>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3 id="methods">Methods</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b> signOut</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>signOut()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to sign out user</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>void</code>
</div>
<div class="io-description">
<p>void</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> saveToken</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>saveToken(token: string)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to save token</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>token</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>void</code>
</div>
<div class="io-description">
<p>void</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getToken</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getToken()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get token</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>string</code>
</div>
<div class="io-description">
<p>string</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> saveUser</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>saveUser(user: any)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to save user</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<ul class="jsdoc-params">
<li>
<div>
<b>user</b>
</div>
<div>
</div>
</li>
</ul>
</div>
<div class="io-description">
<b>Returns: </b> <code>void</code>
</div>
<div class="io-description">
<p>void</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<b><span class="modifier">Public</span> getUser</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play circle">
<span class="fa fa-circle"></span>
</span>
<code>getUser()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Function to get user</p>
</div>
<div class="io-description">
</div>
<div class="io-description">
<b>Returns: </b> <code>any</code>
</div>
<div class="io-description">
<p>any</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { Injectable } from &#x27;@angular/core&#x27;;
const TOKEN_KEY &#x3D; &#x27;auth-token&#x27;;
const USER_KEY &#x3D; &#x27;auth-user&#x27;;
@Injectable({
providedIn: &#x27;root&#x27;,
})
export class TokenStorageService {
constructor() {}
/**
* Function to sign out user
* @returns void
*/
signOut(): void {
window.sessionStorage.clear();
}
/**
* Function to save token
* @param {string} token
* @returns void
*/
public saveToken(token: string): void {
window.sessionStorage.removeItem(TOKEN_KEY);
window.sessionStorage.setItem(TOKEN_KEY, token);
}
/**
* Function to get token
* @returns string
*/
public getToken(): string | null {
return window.sessionStorage.getItem(TOKEN_KEY);
}
/**
* Function to save user
* @param {any} user
* @returns void
*/
public saveUser(user: any): void {
window.sessionStorage.removeItem(USER_KEY);
window.sessionStorage.setItem(USER_KEY, JSON.stringify(user));
}
/**
* Function to get user
* @returns any
*/
public getUser(): any {
const user &#x3D; window.sessionStorage.getItem(USER_KEY);
if (user) {
return JSON.parse(user);
}
return {};
}
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
</body>
</html>