Vitalik
3 years ago
63 changed files with 5775 additions and 370 deletions
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
FROM node:14.0.0 |
||||
|
||||
|
||||
RUN apt-get update |
||||
RUN apt-get install -y build-essential |
||||
RUN apt-get install -y python |
||||
RUN npm install -g @nestjs/cli |
||||
RUN npm install pm2 -g |
||||
|
||||
|
||||
RUN mkdir /home/node/app |
||||
RUN mkdir /home/node/app/node_modules |
||||
|
||||
COPY ./package.json /home/node/app/package.json |
||||
|
||||
RUN chmod -R 777 /home/node |
||||
USER node |
||||
|
||||
RUN cd /home/node/app && ls |
||||
|
||||
|
||||
WORKDIR /home/node/app |
||||
COPY . /home/node/app |
||||
|
||||
# Install development packages if NODE_ENV is set to "development" |
||||
# ARG NODE_ENV |
||||
# ENV NODE_ENV $NODE_ENV |
||||
|
||||
RUN npm install |
@ -0,0 +1,68 @@
@@ -0,0 +1,68 @@
|
||||
version: '3' |
||||
|
||||
services: |
||||
taskme-api: |
||||
build: |
||||
context: ./ |
||||
dockerfile: Dockerfile |
||||
expose: |
||||
- 3000 |
||||
ports: |
||||
- 3000:3000 |
||||
depends_on: |
||||
- taskme-postgres |
||||
- taskme-redis |
||||
- taskme-minio |
||||
links: |
||||
- taskme-postgres |
||||
- taskme-redis |
||||
- taskme-minio |
||||
volumes: |
||||
- ./:/home/node/app |
||||
command: npm run start |
||||
|
||||
taskme-postgres: |
||||
image: postgres:11 |
||||
restart: always |
||||
|
||||
ports: |
||||
- 3303:5432 |
||||
|
||||
environment: |
||||
POSTGRES_PASSWORD: ${DATABASE_PASS} |
||||
POSTGRES_USER: ${DATABASE_USER} |
||||
POSTGRES_DB: ${DATABASE_DB} |
||||
|
||||
taskme-redis: |
||||
image: 'redis:4-alpine' |
||||
command: redis-server --requirepass ${REDIS_PASS} |
||||
ports: |
||||
- '6379:6379' |
||||
|
||||
taskme-minio: |
||||
hostname: taskme-minio |
||||
image: minio/minio |
||||
container_name: taskme-minio |
||||
|
||||
volumes: |
||||
- './taskme/data/:/data' |
||||
- './taskme/config:/root/.minio' |
||||
ports: |
||||
- 9000:9000 |
||||
environment: |
||||
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} |
||||
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} |
||||
command: server /data |
||||
|
||||
taskme-createbuckets: |
||||
image: minio/mc |
||||
depends_on: |
||||
- taskme-minio |
||||
entrypoint: > |
||||
/bin/sh -c " |
||||
sleep 10; |
||||
/usr/bin/mc config host add data http://${MINIO_HOST}:${MINIO_PORT} ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY}; |
||||
/usr/bin/mc mb data/${MINIO_BUCKET}; |
||||
/usr/bin/mc policy set public data/${MINIO_BUCKET}; |
||||
exit 0; |
||||
" |
@ -0,0 +1,202 @@
@@ -0,0 +1,202 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content class"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Classes</li> |
||||
<li >CustomExeption</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/core/exeptions/custom.exeptions.ts</code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Properties</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#isCustom" >isCustom</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
<section> |
||||
|
||||
<h3 id="inputs"> |
||||
Properties |
||||
</h3> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="isCustom"></a> |
||||
<span class="name"> |
||||
<span ><b>isCustom</b></span> |
||||
<a href="#isCustom"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="2" class="link-to-prism">src/core/exeptions/custom.exeptions.ts:2</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">export class CustomExeption { |
||||
isCustom: 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> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'class'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'CustomExeption.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,215 @@
@@ -0,0 +1,215 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content class"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Classes</li> |
||||
<li >UserAlreadyExistException</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/core/exeptions/users.exeptions.ts</code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
<p class="comment"> |
||||
<h3>Extends</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code><a href="../classes/CustomExeption.html" target="_self" >CustomExeption</a></code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Properties</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#isCustom" >isCustom</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
<section> |
||||
|
||||
<h3 id="inputs"> |
||||
Properties |
||||
</h3> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="isCustom"></a> |
||||
<span class="name"> |
||||
<span ><b>isCustom</b></span> |
||||
<a href="#isCustom"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Inherited from <code><a href="../classes/CustomExeption.html" target="_self" >CustomExeption</a></code> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <code><a href="../classes/CustomExeption.html#source" target="_self" >CustomExeption:2</a></code> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { CustomExeption } from './custom.exeptions' |
||||
|
||||
export class UserAlreadyExistException extends CustomExeption {} |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'class'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'UserAlreadyExistException.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 894 B |
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,610 @@
@@ -0,0 +1,610 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content injectable"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Injectables</li> |
||||
<li >UsersPasswordsService</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/domain/users/services/users-passwords.service.ts</code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Properties</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<span class="modifier">Private</span> |
||||
<a href="#localHashSalt" >localHashSalt</a> |
||||
</li> |
||||
<li> |
||||
<span class="modifier">Private</span> |
||||
<span class="modifier">Readonly</span> |
||||
<a href="#saltRounds" >saltRounds</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Methods</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<span class="modifier">Private</span> |
||||
<span class="modifier">Async</span> |
||||
<a href="#comparePass" >comparePass</a> |
||||
</li> |
||||
<li> |
||||
<span class="modifier">Public</span> |
||||
<a href="#createUserSalt" >createUserSalt</a> |
||||
</li> |
||||
<li> |
||||
<span class="modifier">Private</span> |
||||
<a href="#getSalt" >getSalt</a> |
||||
</li> |
||||
<li> |
||||
<span class="modifier">Public</span> |
||||
<span class="modifier">Async</span> |
||||
<a href="#hashPassword" >hashPassword</a> |
||||
</li> |
||||
</ul> |
||||
</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"> |
||||
<a name="comparePass"></a> |
||||
<span class="name"> |
||||
<span class="modifier">Private</span> |
||||
<span class="modifier">Async</span> |
||||
<span ><b>comparePass</b></span> |
||||
<a href="#comparePass"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<span class="modifier-icon icon ion-ios-reset"></span> |
||||
<code>comparePass(password: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, salt: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, hash: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="29" |
||||
class="link-to-prism">src/domain/users/services/users-passwords.service.ts:29</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
|
||||
<div class="io-description"> |
||||
<b>Parameters :</b> |
||||
<table class="params"> |
||||
<thead> |
||||
<tr> |
||||
<td>Name</td> |
||||
<td>Type</td> |
||||
<td>Optional</td> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr> |
||||
<td>password</td> |
||||
<td> |
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
</tr> |
||||
<tr> |
||||
<td>salt</td> |
||||
<td> |
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
</tr> |
||||
<tr> |
||||
<td>hash</td> |
||||
<td> |
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div> |
||||
</div> |
||||
<div class="io-description"> |
||||
<b>Returns : </b> <code>Promise<boolean></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"> |
||||
<a name="createUserSalt"></a> |
||||
<span class="name"> |
||||
<span class="modifier">Public</span> |
||||
<span ><b>createUserSalt</b></span> |
||||
<a href="#createUserSalt"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<span class="modifier-icon icon ion-ios-reset"></span> |
||||
<code>createUserSalt()</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="33" |
||||
class="link-to-prism">src/domain/users/services/users-passwords.service.ts:33</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
|
||||
<div class="io-description"> |
||||
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="getSalt"></a> |
||||
<span class="name"> |
||||
<span class="modifier">Private</span> |
||||
<span ><b>getSalt</b></span> |
||||
<a href="#getSalt"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<span class="modifier-icon icon ion-ios-reset"></span> |
||||
<code>getSalt(userSalt: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="37" |
||||
class="link-to-prism">src/domain/users/services/users-passwords.service.ts:37</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
|
||||
<div class="io-description"> |
||||
<b>Parameters :</b> |
||||
<table class="params"> |
||||
<thead> |
||||
<tr> |
||||
<td>Name</td> |
||||
<td>Type</td> |
||||
<td>Optional</td> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr> |
||||
<td>userSalt</td> |
||||
<td> |
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div> |
||||
</div> |
||||
<div class="io-description"> |
||||
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></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"> |
||||
<a name="hashPassword"></a> |
||||
<span class="name"> |
||||
<span class="modifier">Public</span> |
||||
<span class="modifier">Async</span> |
||||
<span ><b>hashPassword</b></span> |
||||
<a href="#hashPassword"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<span class="modifier-icon icon ion-ios-reset"></span> |
||||
<code>hashPassword(password: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, salt: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="25" |
||||
class="link-to-prism">src/domain/users/services/users-passwords.service.ts:25</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
|
||||
<div class="io-description"> |
||||
<b>Parameters :</b> |
||||
<table class="params"> |
||||
<thead> |
||||
<tr> |
||||
<td>Name</td> |
||||
<td>Type</td> |
||||
<td>Optional</td> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr> |
||||
<td>password</td> |
||||
<td> |
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
</tr> |
||||
<tr> |
||||
<td>salt</td> |
||||
<td> |
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div> |
||||
</div> |
||||
<div class="io-description"> |
||||
<b>Returns : </b> <code>Promise<string></code> |
||||
|
||||
</div> |
||||
<div class="io-description"> |
||||
|
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
<section> |
||||
|
||||
<h3 id="inputs"> |
||||
Properties |
||||
</h3> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="localHashSalt"></a> |
||||
<span class="name"> |
||||
<span class="modifier">Private</span> |
||||
<span ><b>localHashSalt</b></span> |
||||
<a href="#localHashSalt"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<b>Decorators : </b> |
||||
<br /> |
||||
<code> |
||||
@Inject(PASSWORD_HASH_SALT)<br /> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="12" class="link-to-prism">src/domain/users/services/users-passwords.service.ts:12</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="saltRounds"></a> |
||||
<span class="name"> |
||||
<span class="modifier">Private</span> |
||||
<span class="modifier">Readonly</span> |
||||
<span ><b>saltRounds</b></span> |
||||
<a href="#saltRounds"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Default value : </i><code>10</code> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="9" class="link-to-prism">src/domain/users/services/users-passwords.service.ts:9</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Inject, Injectable } from '@nestjs/common' |
||||
import * as bcrypt from 'bcryptjs' |
||||
import * as randomstring from 'randomstring' |
||||
import { Repository } from 'typeorm' |
||||
import { PASSWORD_HASH_SALT } from '../consts' |
||||
|
||||
@Injectable() |
||||
export class UsersPasswordsService { |
||||
private readonly saltRounds = 10 |
||||
|
||||
@Inject(PASSWORD_HASH_SALT) |
||||
private localHashSalt: string |
||||
|
||||
// public async compareUserPasswords(userId: number, password: string) { |
||||
// const user = await this.usersRepository.findOne({id: userId}) |
||||
// return this.comparePass(password, user.passwordSalt, user.password) |
||||
// } |
||||
|
||||
// public async changeUserPassword(userId: number, newPassword: string): Promise<void> { |
||||
// const user = await this.usersRepository.findOne({id: userId}) |
||||
// user.password = await this.hashPassword(newPassword, user.passwordSalt) |
||||
// await this.usersRepository.save(user) |
||||
// } |
||||
|
||||
public async hashPassword(password: string, salt: string): Promise<string> { |
||||
return bcrypt.hash(this.getSalt(salt) + password, this.saltRounds) |
||||
} |
||||
|
||||
private async comparePass(password: string, salt: string, hash: string): Promise<boolean> { |
||||
return await bcrypt.compare(this.getSalt(salt) + password, hash) |
||||
} |
||||
|
||||
public createUserSalt(): string { |
||||
return randomstring.generate(10) |
||||
} |
||||
|
||||
private getSalt(userSalt: string): string { |
||||
return this.localHashSalt + userSalt |
||||
} |
||||
} |
||||
</code></pre> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'UsersPasswordsService.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,338 @@
@@ -0,0 +1,338 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content interface"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Interfaces</li> |
||||
<li |
||||
> |
||||
IUsersService</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/core/namespaces/users.namespace.ts</code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Methods</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#save" |
||||
> |
||||
save |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</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"> |
||||
<a name="save"></a> |
||||
<span class="name"> |
||||
<span ><b>save</b></span> |
||||
<a href="#save"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>save(payload: <a href="../interfaces/SaveUserPaylod.html" target="_self">SaveUserPaylod</a>)</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="89" |
||||
class="link-to-prism">src/core/namespaces/users.namespace.ts:89</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Метод для створення користувача</p> |
||||
</div> |
||||
|
||||
<div class="io-description"> |
||||
<b>Parameters :</b> |
||||
<table class="params"> |
||||
<thead> |
||||
<tr> |
||||
<td>Name</td> |
||||
<td>Type</td> |
||||
<td>Optional</td> |
||||
<td>Description</td> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr> |
||||
<td>payload</td> |
||||
<td> |
||||
<code><a href="../interfaces/SaveUserPaylod.html" target="_self" >SaveUserPaylod</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
<td> |
||||
<ul> |
||||
<li>Данні нового користувача</li> |
||||
</ul> |
||||
|
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div> |
||||
</div> |
||||
<div class="io-description"> |
||||
<b>Returns : </b> <code>Promise<number></code> |
||||
|
||||
</div> |
||||
<div class="io-description"> |
||||
<p>Повертає id створеного користувача</p> |
||||
|
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">export namespace Users { |
||||
/** |
||||
* Роль користувача |
||||
*/ |
||||
export enum Role { |
||||
Admin = 'a', |
||||
User = 'u', |
||||
} |
||||
|
||||
/** |
||||
* Базовий інтерфейс користувача |
||||
*/ |
||||
export interface UserModel { |
||||
/** Унікальний ідентифікатор */ |
||||
id: number |
||||
|
||||
/** Роль користувача, можливі значення Role.Admin, Role.User */ |
||||
role: Role |
||||
|
||||
/** Почта користувача */ |
||||
email: string |
||||
|
||||
/** Робочий номер телефону по якому відбуваеться авторизація */ |
||||
phoneNumber: string |
||||
|
||||
/** Пароль в зашифрованому вигляді */ |
||||
password: string |
||||
|
||||
/** Сіль для шифрування паролю */ |
||||
passwordSalt: string |
||||
} |
||||
|
||||
/** |
||||
* Інтерфейс інформації про користувача |
||||
*/ |
||||
export interface Info { |
||||
/** Ідентифікатор користувача */ |
||||
userId: string |
||||
|
||||
/** Імя користувача*/ |
||||
firstName: string |
||||
|
||||
/** Прізвище користувача*/ |
||||
lastName: string |
||||
|
||||
/** По-батькові */ |
||||
surname: string |
||||
|
||||
/** Позиція на роботі */ |
||||
position: string |
||||
|
||||
/** Дата народження */ |
||||
dateOfBirth: string |
||||
|
||||
/** Посилання на зображення користувача */ |
||||
avatarUrl: string |
||||
|
||||
/** Додаток активований*/ |
||||
isActivedApp: boolean |
||||
|
||||
/** Дата створення */ |
||||
createdAt: string |
||||
|
||||
/** Дата останньої зміни */ |
||||
updatedAt: string |
||||
} |
||||
|
||||
export interface SaveUserPaylod { |
||||
role: Role |
||||
email: string |
||||
phoneNumber: string |
||||
password: string |
||||
firstName: string |
||||
lastName: string |
||||
surname: string |
||||
position: string |
||||
dateOfBirth: string |
||||
avatarUrl: string |
||||
isActivedApp: boolean |
||||
} |
||||
|
||||
export interface IUsersService { |
||||
/** |
||||
* Метод для створення користувача |
||||
* @param {SaveUserPaylod} payload - Данні нового користувача |
||||
* @returns Повертає id створеного користувача |
||||
*/ |
||||
|
||||
save(payload: SaveUserPaylod): Promise<number> |
||||
} |
||||
} |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'IUsersService.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,709 @@
@@ -0,0 +1,709 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content interface"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Interfaces</li> |
||||
<li |
||||
> |
||||
Info</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/core/namespaces/users.namespace.ts</code> |
||||
</p> |
||||
|
||||
|
||||
<p class="comment"> |
||||
<h3>Description</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<p>Інтерфейс інформації про користувача</p> |
||||
|
||||
</p> |
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Properties</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#avatarUrl" |
||||
> |
||||
avatarUrl |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#createdAt" |
||||
> |
||||
createdAt |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#dateOfBirth" |
||||
> |
||||
dateOfBirth |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#firstName" |
||||
> |
||||
firstName |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#isActivedApp" |
||||
> |
||||
isActivedApp |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#lastName" |
||||
> |
||||
lastName |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#position" |
||||
> |
||||
position |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#surname" |
||||
> |
||||
surname |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#updatedAt" |
||||
> |
||||
updatedAt |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#userId" |
||||
> |
||||
userId |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="inputs">Properties</h3> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="avatarUrl"></a> |
||||
<span class="name "><b>avatarUrl</b> |
||||
<a href="#avatarUrl"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>avatarUrl: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Посилання на зображення користувача</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="createdAt"></a> |
||||
<span class="name "><b>createdAt</b> |
||||
<a href="#createdAt"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>createdAt: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Дата створення</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="dateOfBirth"></a> |
||||
<span class="name "><b>dateOfBirth</b> |
||||
<a href="#dateOfBirth"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>dateOfBirth: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Дата народження</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="firstName"></a> |
||||
<span class="name "><b>firstName</b> |
||||
<a href="#firstName"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>firstName: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Імя користувача</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="isActivedApp"></a> |
||||
<span class="name "><b>isActivedApp</b> |
||||
<a href="#isActivedApp"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>isActivedApp: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Додаток активований</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="lastName"></a> |
||||
<span class="name "><b>lastName</b> |
||||
<a href="#lastName"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>lastName: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Прізвище користувача</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="position"></a> |
||||
<span class="name "><b>position</b> |
||||
<a href="#position"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>position: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Позиція на роботі</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="surname"></a> |
||||
<span class="name "><b>surname</b> |
||||
<a href="#surname"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>surname: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>По-батькові</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="updatedAt"></a> |
||||
<span class="name "><b>updatedAt</b> |
||||
<a href="#updatedAt"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>updatedAt: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Дата останньої зміни</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="userId"></a> |
||||
<span class="name "><b>userId</b> |
||||
<a href="#userId"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>userId: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Ідентифікатор користувача</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">export namespace Users { |
||||
/** |
||||
* Роль користувача |
||||
*/ |
||||
export enum Role { |
||||
Admin = 'a', |
||||
User = 'u', |
||||
} |
||||
|
||||
/** |
||||
* Базовий інтерфейс користувача |
||||
*/ |
||||
export interface UserModel { |
||||
/** Унікальний ідентифікатор */ |
||||
id: number |
||||
|
||||
/** Роль користувача, можливі значення Role.Admin, Role.User */ |
||||
role: Role |
||||
|
||||
/** Почта користувача */ |
||||
email: string |
||||
|
||||
/** Робочий номер телефону по якому відбуваеться авторизація */ |
||||
phoneNumber: string |
||||
|
||||
/** Пароль в зашифрованому вигляді */ |
||||
password: string |
||||
|
||||
/** Сіль для шифрування паролю */ |
||||
passwordSalt: string |
||||
} |
||||
|
||||
/** |
||||
* Інтерфейс інформації про користувача |
||||
*/ |
||||
export interface Info { |
||||
/** Ідентифікатор користувача */ |
||||
userId: string |
||||
|
||||
/** Імя користувача*/ |
||||
firstName: string |
||||
|
||||
/** Прізвище користувача*/ |
||||
lastName: string |
||||
|
||||
/** По-батькові */ |
||||
surname: string |
||||
|
||||
/** Позиція на роботі */ |
||||
position: string |
||||
|
||||
/** Дата народження */ |
||||
dateOfBirth: string |
||||
|
||||
/** Посилання на зображення користувача */ |
||||
avatarUrl: string |
||||
|
||||
/** Додаток активований*/ |
||||
isActivedApp: boolean |
||||
|
||||
/** Дата створення */ |
||||
createdAt: string |
||||
|
||||
/** Дата останньої зміни */ |
||||
updatedAt: string |
||||
} |
||||
|
||||
export interface SaveUserPaylod { |
||||
role: Role |
||||
email: string |
||||
phoneNumber: string |
||||
password: string |
||||
firstName: string |
||||
lastName: string |
||||
surname: string |
||||
position: string |
||||
dateOfBirth: string |
||||
avatarUrl: string |
||||
isActivedApp: boolean |
||||
} |
||||
|
||||
export interface IUsersService { |
||||
/** |
||||
* Метод для створення користувача |
||||
* @param {SaveUserPaylod} payload - Данні нового користувача |
||||
* @returns Повертає id створеного користувача |
||||
*/ |
||||
|
||||
save(payload: SaveUserPaylod): Promise<number> |
||||
} |
||||
} |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'Info.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,681 @@
@@ -0,0 +1,681 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content interface"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Interfaces</li> |
||||
<li |
||||
> |
||||
SaveUserPaylod</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/core/namespaces/users.namespace.ts</code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Properties</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#avatarUrl" |
||||
> |
||||
avatarUrl |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#dateOfBirth" |
||||
> |
||||
dateOfBirth |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#email" |
||||
> |
||||
email |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#firstName" |
||||
> |
||||
firstName |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#isActivedApp" |
||||
> |
||||
isActivedApp |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#lastName" |
||||
> |
||||
lastName |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#password" |
||||
> |
||||
password |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#phoneNumber" |
||||
> |
||||
phoneNumber |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#position" |
||||
> |
||||
position |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#role" |
||||
> |
||||
role |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#surname" |
||||
> |
||||
surname |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="inputs">Properties</h3> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="avatarUrl"></a> |
||||
<span class="name "><b>avatarUrl</b> |
||||
<a href="#avatarUrl"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>avatarUrl: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="dateOfBirth"></a> |
||||
<span class="name "><b>dateOfBirth</b> |
||||
<a href="#dateOfBirth"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>dateOfBirth: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="email"></a> |
||||
<span class="name "><b>email</b> |
||||
<a href="#email"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>email: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="firstName"></a> |
||||
<span class="name "><b>firstName</b> |
||||
<a href="#firstName"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>firstName: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="isActivedApp"></a> |
||||
<span class="name "><b>isActivedApp</b> |
||||
<a href="#isActivedApp"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>isActivedApp: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="lastName"></a> |
||||
<span class="name "><b>lastName</b> |
||||
<a href="#lastName"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>lastName: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="password"></a> |
||||
<span class="name "><b>password</b> |
||||
<a href="#password"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>password: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="phoneNumber"></a> |
||||
<span class="name "><b>phoneNumber</b> |
||||
<a href="#phoneNumber"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>phoneNumber: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="position"></a> |
||||
<span class="name "><b>position</b> |
||||
<a href="#position"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>position: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="role"></a> |
||||
<span class="name "><b>role</b> |
||||
<a href="#role"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>role: <code><a href="../miscellaneous/enumerations.html#Role" target="_self" >Role</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="../miscellaneous/enumerations.html#Role" target="_self" >Role</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="surname"></a> |
||||
<span class="name "><b>surname</b> |
||||
<a href="#surname"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>surname: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">export namespace Users { |
||||
/** |
||||
* Роль користувача |
||||
*/ |
||||
export enum Role { |
||||
Admin = 'a', |
||||
User = 'u', |
||||
} |
||||
|
||||
/** |
||||
* Базовий інтерфейс користувача |
||||
*/ |
||||
export interface UserModel { |
||||
/** Унікальний ідентифікатор */ |
||||
id: number |
||||
|
||||
/** Роль користувача, можливі значення Role.Admin, Role.User */ |
||||
role: Role |
||||
|
||||
/** Почта користувача */ |
||||
email: string |
||||
|
||||
/** Робочий номер телефону по якому відбуваеться авторизація */ |
||||
phoneNumber: string |
||||
|
||||
/** Пароль в зашифрованому вигляді */ |
||||
password: string |
||||
|
||||
/** Сіль для шифрування паролю */ |
||||
passwordSalt: string |
||||
} |
||||
|
||||
/** |
||||
* Інтерфейс інформації про користувача |
||||
*/ |
||||
export interface Info { |
||||
/** Ідентифікатор користувача */ |
||||
userId: string |
||||
|
||||
/** Імя користувача*/ |
||||
firstName: string |
||||
|
||||
/** Прізвище користувача*/ |
||||
lastName: string |
||||
|
||||
/** По-батькові */ |
||||
surname: string |
||||
|
||||
/** Позиція на роботі */ |
||||
position: string |
||||
|
||||
/** Дата народження */ |
||||
dateOfBirth: string |
||||
|
||||
/** Посилання на зображення користувача */ |
||||
avatarUrl: string |
||||
|
||||
/** Додаток активований*/ |
||||
isActivedApp: boolean |
||||
|
||||
/** Дата створення */ |
||||
createdAt: string |
||||
|
||||
/** Дата останньої зміни */ |
||||
updatedAt: string |
||||
} |
||||
|
||||
export interface SaveUserPaylod { |
||||
role: Role |
||||
email: string |
||||
phoneNumber: string |
||||
password: string |
||||
firstName: string |
||||
lastName: string |
||||
surname: string |
||||
position: string |
||||
dateOfBirth: string |
||||
avatarUrl: string |
||||
isActivedApp: boolean |
||||
} |
||||
|
||||
export interface IUsersService { |
||||
/** |
||||
* Метод для створення користувача |
||||
* @param {SaveUserPaylod} payload - Данні нового користувача |
||||
* @returns Повертає id створеного користувача |
||||
*/ |
||||
|
||||
save(payload: SaveUserPaylod): Promise<number> |
||||
} |
||||
} |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'SaveUserPaylod.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,330 @@
@@ -0,0 +1,330 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>api-taskme 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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">api-taskme documentation</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content interface"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Interfaces</li> |
||||
<li |
||||
> |
||||
Service</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/core/namespaces/users.namespace.ts</code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Methods</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#save" |
||||
> |
||||
save |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</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"> |
||||
<a name="save"></a> |
||||
<span class="name"> |
||||
<span ><b>save</b></span> |
||||
<a href="#save"><span class="icon ion-ios-link"></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>save(paylod: <a href="../interfaces/SaveUserPaylod.html" target="_self">SaveUserPaylod</a>)</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-line">Defined in <a href="" data-line="89" |
||||
class="link-to-prism">src/core/namespaces/users.namespace.ts:89</a></div> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Метод для створення користувача</p> |
||||
</div> |
||||
|
||||
<div class="io-description"> |
||||
<b>Parameters :</b> |
||||
<table class="params"> |
||||
<thead> |
||||
<tr> |
||||
<td>Name</td> |
||||
<td>Type</td> |
||||
<td>Optional</td> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr> |
||||
<td>paylod</td> |
||||
<td> |
||||
<code><a href="../interfaces/SaveUserPaylod.html" target="_self" >SaveUserPaylod</a></code> |
||||
</td> |
||||
|
||||
<td> |
||||
No |
||||
</td> |
||||
|
||||
|
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div> |
||||
</div> |
||||
<div class="io-description"> |
||||
<b>Returns : </b> <code>Promise<number></code> |
||||
|
||||
</div> |
||||
<div class="io-description"> |
||||
<p>Повертає id створеного користувача</p> |
||||
|
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">export namespace Users { |
||||
/** |
||||
* Роль користувача |
||||
*/ |
||||
export enum Role { |
||||
Admin = 'a', |
||||
User = 'u', |
||||
} |
||||
|
||||
/** |
||||
* Базовий інтерфейс користувача |
||||
*/ |
||||
export interface UserModel { |
||||
/** Унікальний ідентифікатор */ |
||||
id: number |
||||
|
||||
/** Роль користувача, можливі значення Role.Admin, Role.User */ |
||||
role: Role |
||||
|
||||
/** Почта користувача */ |
||||
email: string |
||||
|
||||
/** Робочий номер телефону по якому відбуваеться авторизація */ |
||||
phoneNumber: string |
||||
|
||||
/** Пароль в зашифрованому вигляді */ |
||||
password: string |
||||
|
||||
/** Сіль для шифрування паролю */ |
||||
passwordSalt: string |
||||
} |
||||
|
||||
/** |
||||
* Інтерфейс інформації про користувача |
||||
*/ |
||||
export interface Info { |
||||
/** Ідентифікатор користувача */ |
||||
userId: string |
||||
|
||||
/** Імя користувача*/ |
||||
firstName: string |
||||
|
||||
/** Прізвище користувача*/ |
||||
lastName: string |
||||
|
||||
/** По-батькові */ |
||||
surname: string |
||||
|
||||
/** Позиція на роботі */ |
||||
position: string |
||||
|
||||
/** Дата народження */ |
||||
dateOfBirth: string |
||||
|
||||
/** Посилання на зображення користувача */ |
||||
avatarUrl: string |
||||
|
||||
/** Додаток активований*/ |
||||
isActivedApp: boolean |
||||
|
||||
/** Дата створення */ |
||||
createdAt: string |
||||
|
||||
/** Дата останньої зміни */ |
||||
updatedAt: string |
||||
} |
||||
|
||||
export interface SaveUserPaylod { |
||||
role: Role |
||||
email: string |
||||
phoneNumber: string |
||||
password: string |
||||
firstName: string |
||||
lastName: string |
||||
surname: string |
||||
position: string |
||||
dateOfBirth: string |
||||
avatarUrl: string |
||||
isActivedApp: boolean |
||||
} |
||||
|
||||
export interface Service { |
||||
/** |
||||
* Метод для створення користувача |
||||
* @payload - Данні нового користувача |
||||
* @returns Повертає id створеного користувача |
||||
*/ |
||||
|
||||
save(paylod: SaveUserPaylod): Promise<number> |
||||
} |
||||
} |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'Service.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,529 @@
@@ -0,0 +1,529 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content interface"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Interfaces</li> |
||||
<li |
||||
> |
||||
UserModel</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/core/namespaces/users.namespace.ts</code> |
||||
</p> |
||||
|
||||
|
||||
<p class="comment"> |
||||
<h3>Description</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<p> Базовий інтерфейс користувача</p> |
||||
|
||||
</p> |
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Properties</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#email" |
||||
> |
||||
email |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#id" |
||||
> |
||||
id |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#password" |
||||
> |
||||
password |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#passwordSalt" |
||||
> |
||||
passwordSalt |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#phoneNumber" |
||||
> |
||||
phoneNumber |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#role" |
||||
> |
||||
role |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="inputs">Properties</h3> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="email"></a> |
||||
<span class="name "><b>email</b> |
||||
<a href="#email"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>email: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Почта користувача</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="id"></a> |
||||
<span class="name "><b>id</b> |
||||
<a href="#id"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>id: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Унікальний ідентифікатор</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="password"></a> |
||||
<span class="name "><b>password</b> |
||||
<a href="#password"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>password: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Пароль в зашифрованому вигляді</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="passwordSalt"></a> |
||||
<span class="name "><b>passwordSalt</b> |
||||
<a href="#passwordSalt"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>passwordSalt: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Сіль для шифрування паролю</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="phoneNumber"></a> |
||||
<span class="name "><b>phoneNumber</b> |
||||
<a href="#phoneNumber"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>phoneNumber: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Робочий номер телефону по якому відбуваеться авторизація</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="role"></a> |
||||
<span class="name "><b>role</b> |
||||
<a href="#role"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>role: <code><a href="../miscellaneous/enumerations.html#Role" target="_self" >Role</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="../miscellaneous/enumerations.html#Role" target="_self" >Role</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<div class="io-description"><p>Роль користувача, можливі значення Role.Admin, Role.User</p> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">export namespace Users { |
||||
/** |
||||
* Роль користувача |
||||
*/ |
||||
export enum Role { |
||||
Admin = 'a', |
||||
User = 'u', |
||||
} |
||||
|
||||
/** |
||||
* Базовий інтерфейс користувача |
||||
*/ |
||||
export interface UserModel { |
||||
/** Унікальний ідентифікатор */ |
||||
id: number |
||||
|
||||
/** Роль користувача, можливі значення Role.Admin, Role.User */ |
||||
role: Role |
||||
|
||||
/** Почта користувача */ |
||||
email: string |
||||
|
||||
/** Робочий номер телефону по якому відбуваеться авторизація */ |
||||
phoneNumber: string |
||||
|
||||
/** Пароль в зашифрованому вигляді */ |
||||
password: string |
||||
|
||||
/** Сіль для шифрування паролю */ |
||||
passwordSalt: string |
||||
} |
||||
|
||||
/** |
||||
* Інтерфейс інформації про користувача |
||||
*/ |
||||
export interface Info { |
||||
/** Ідентифікатор користувача */ |
||||
userId: string |
||||
|
||||
/** Імя користувача*/ |
||||
firstName: string |
||||
|
||||
/** Прізвище користувача*/ |
||||
lastName: string |
||||
|
||||
/** По-батькові */ |
||||
surname: string |
||||
|
||||
/** Позиція на роботі */ |
||||
position: string |
||||
|
||||
/** Дата народження */ |
||||
dateOfBirth: string |
||||
|
||||
/** Посилання на зображення користувача */ |
||||
avatarUrl: string |
||||
|
||||
/** Додаток активований*/ |
||||
isActivedApp: boolean |
||||
|
||||
/** Дата створення */ |
||||
createdAt: string |
||||
|
||||
/** Дата останньої зміни */ |
||||
updatedAt: string |
||||
} |
||||
|
||||
export interface SaveUserPaylod { |
||||
role: Role |
||||
email: string |
||||
phoneNumber: string |
||||
password: string |
||||
firstName: string |
||||
lastName: string |
||||
surname: string |
||||
position: string |
||||
dateOfBirth: string |
||||
avatarUrl: string |
||||
isActivedApp: boolean |
||||
} |
||||
|
||||
export interface IUsersService { |
||||
/** |
||||
* Метод для створення користувача |
||||
* @param {SaveUserPaylod} payload - Данні нового користувача |
||||
* @returns Повертає id створеного користувача |
||||
*/ |
||||
|
||||
save(payload: SaveUserPaylod): Promise<number> |
||||
} |
||||
} |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'UserModel.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,203 @@
@@ -0,0 +1,203 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>TaskMe</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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
<link rel="stylesheet" href="../styles/laravel.css"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">TaskMe</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content interface"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Interfaces</li> |
||||
<li |
||||
> |
||||
UsersModuleOptions</li> |
||||
</ol> |
||||
|
||||
<ul class="nav nav-tabs" role="tablist"> |
||||
<li class="active"> |
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a> |
||||
</li> |
||||
<li > |
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="tab-content"> |
||||
<div class="tab-pane fade active in" id="c-info"> |
||||
<p class="comment"> |
||||
<h3>File</h3> |
||||
</p> |
||||
<p class="comment"> |
||||
<code>src/domain/users/interfaces/users-module-options.interface.ts</code> |
||||
</p> |
||||
|
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<h6><b>Properties</b></h6> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#passwordHashSalt" |
||||
> |
||||
passwordHashSalt |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
|
||||
<section> |
||||
<h3 id="inputs">Properties</h3> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="passwordHashSalt"></a> |
||||
<span class="name "><b>passwordHashSalt</b> |
||||
<a href="#passwordHashSalt"> |
||||
<span class="icon ion-ios-link"></span> |
||||
</a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code>passwordHashSalt: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> |
||||
|
||||
</td> |
||||
</tr> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
</div> |
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source"> |
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">export interface UsersModuleOptions { |
||||
passwordHashSalt: string |
||||
} |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'UsersModuleOptions.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,141 @@
@@ -0,0 +1,141 @@
|
||||
<!doctype html> |
||||
<html class="no-js" lang=""> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
||||
<title>api-taskme 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"> |
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)"> |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs"> |
||||
<a href="../" class="navbar-brand">api-taskme documentation</a> |
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" 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> <compodoc-menu></compodoc-menu> |
||||
</div> |
||||
|
||||
<div class="container-fluid main"> |
||||
<div class="row main"> |
||||
<div class="hidden-xs menu"> |
||||
<compodoc-menu mode="normal"></compodoc-menu> |
||||
</div> |
||||
<!-- START CONTENT --> |
||||
<div class="content miscellaneous-typealiases"> |
||||
<div class="content-data"> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb"> |
||||
<li>Miscellaneous</li> |
||||
<li>Type aliases</li> |
||||
</ol> |
||||
|
||||
<section> |
||||
<h3 id="index">Index</h3> |
||||
<table class="table table-sm table-bordered index-table"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<ul class="index-list"> |
||||
<li> |
||||
<a href="#SaveUserPaylod" title="src/core/namespaces/users.namespace.ts" ><b>SaveUserPaylod</b> (src/.../users.namespace.ts)</a> |
||||
</li> |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
<h3>src/core/namespaces/users.namespace.ts</h3> |
||||
<section> |
||||
<table class="table table-sm table-bordered"> |
||||
<tbody> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<a name="SaveUserPaylod"></a> |
||||
<span class="name "><b>SaveUserPaylod</b><a href="#SaveUserPaylod"><span class="icon ion-ios-link"></span></a></span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="col-md-4"> |
||||
<code> <code></code> |
||||
</code> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</section> |
||||
|
||||
|
||||
</div><div class="search-results"> |
||||
<div class="has-results"> |
||||
<h1 class="search-results-title"><span class='search-results-count'></span> result-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> |
||||
<!-- END CONTENT --> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1; |
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'miscellaneous-typealiases'; |
||||
var COMPODOC_CURRENT_PAGE_URL = 'typealiases.html'; |
||||
var MAX_SEARCH_RESULTS = 15; |
||||
</script> |
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script> |
||||
<script src="../js/libs/lit-html.js"></script> |
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script> |
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script> |
||||
|
||||
<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/tabs.js"></script> |
||||
<script src="../js/menu.js"></script> |
||||
<script src="../js/libs/clipboard.min.js"></script> |
||||
<script src="../js/libs/prism.js"></script> |
||||
<script src="../js/sourceCode.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/search/search_index.js"></script> |
||||
<script src="../js/lazy-load-graphs.js"></script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
module.exports = { |
||||
apps: [ |
||||
{ |
||||
name: 'api', |
||||
script: './dist/main.js', |
||||
node_args: '-r dotenv/config', |
||||
watch: true, |
||||
}, |
||||
], |
||||
} |
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
import { USERS_ENTITIES } from 'src/domain/users/entities' |
||||
|
||||
export const ENTITIES = [...USERS_ENTITIES] |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
export class CustomExeption { |
||||
isCustom: true |
||||
} |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
export * from './users.exeptions' |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
import { CustomExeption } from './custom.exeptions' |
||||
|
||||
export class UserAlreadyExistException extends CustomExeption {} |
@ -1 +1,2 @@
@@ -1 +1,2 @@
|
||||
export * from './exeptions' |
||||
export * from './namespaces' |
||||
|
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
export * from './users/users.module' |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
import { DynamicModule, Module } from '@nestjs/common' |
||||
|
||||
@Module({}) |
||||
export class SessionsModule { |
||||
static getProviders() { |
||||
return [] |
||||
} |
||||
|
||||
static forRoot(): DynamicModule { |
||||
return { |
||||
module: SessionsModule, |
||||
} |
||||
} |
||||
|
||||
static forFeature(): DynamicModule { |
||||
return { |
||||
module: SessionsModule, |
||||
} |
||||
} |
||||
} |
@ -1,24 +1,72 @@
@@ -1,24 +1,72 @@
|
||||
import { UserAlreadyExistException, Users } from 'src/core' |
||||
import { formatPhoneNumber } from 'src/shared' |
||||
import { Repository } from 'typeorm' |
||||
|
||||
interface UserPaylod { |
||||
name: string |
||||
email: string |
||||
} |
||||
type Payload = Users.SaveUserPaylod & { passwordSalt: string } |
||||
|
||||
export class UserCreator { |
||||
private userRepository: Repository<UserPaylod> |
||||
private payload: UserPaylod |
||||
private userRepository: Repository<Users.UserModel> |
||||
private infoRepository: Repository<Users.Info> |
||||
private payload: Payload |
||||
|
||||
constructor(payload: Payload) { |
||||
this.setPaylod(payload) |
||||
} |
||||
|
||||
private async validate(payload: Payload) { |
||||
const existUser = await this.userRepository |
||||
.createQueryBuilder('it') |
||||
.select('it.id') |
||||
.where('it.email = :email', { email: payload.email }) |
||||
.orWhere('it.phoneNumber = :phoneNumber', { phoneNumber: payload.phoneNumber }) |
||||
.getOne() |
||||
|
||||
if (existUser) throw new UserAlreadyExistException() |
||||
} |
||||
|
||||
private preparePayload(payload: Payload): Payload { |
||||
return { |
||||
...payload, |
||||
phoneNumber: formatPhoneNumber(payload.phoneNumber), |
||||
} |
||||
} |
||||
|
||||
public setData(paylod: UserPaylod) { |
||||
this.payload = paylod |
||||
private onError(error: any) { |
||||
console.log('UserCreator: Error: ', error) |
||||
if (error.isCustom) throw error |
||||
} |
||||
|
||||
private async createUser() { |
||||
return this.userRepository.insert({ |
||||
email: this.payload.email, |
||||
password: this.payload.password, |
||||
passwordSalt: this.payload.passwordSalt, |
||||
phoneNumber: this.payload.phoneNumber, |
||||
}) |
||||
} |
||||
|
||||
public setPaylod(payload: Payload) { |
||||
this.payload = this.preparePayload(payload) |
||||
return this |
||||
} |
||||
public setRepository(repository: Repository<UserPaylod>) { |
||||
public setRepositories(repository: Repository<Users.UserModel>) { |
||||
this.userRepository = repository |
||||
return this |
||||
} |
||||
|
||||
public async save() { |
||||
return this.payload |
||||
public async run() { |
||||
try { |
||||
if (!this.userRepository || !this.payload) throw new Error('User creator not prepared') |
||||
|
||||
await this.validate(this.payload) |
||||
|
||||
console.log(this.payload) |
||||
const result = await this.createUser() |
||||
|
||||
console.log(result) |
||||
return 1 |
||||
} catch (e) { |
||||
this.onError(e) |
||||
} |
||||
} |
||||
} |
||||
|
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
export const PASSWORD_HASH_SALT = Symbol('PASSWORD_HASH_SALT') |
||||
|
||||
export const USERS_REPOSITORY = Symbol('USERS_REPOSITORY') |
||||
export const USERS_INFOS_REPOSITORY = Symbol('USERS_INFOS_REPOSITORY') |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
export * from './users-db.interfaces' |
||||
export * from './users-module-options.interface' |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
import { Users } from 'src/core' |
||||
import { Repository } from 'typeorm' |
||||
|
||||
export type IUsersRepository = Repository<Users.UserModel> |
||||
export type IUsersInfoRepository = Repository<Users.UserModel> |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
export interface UsersModuleOptions { |
||||
passwordHashSalt: string |
||||
} |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
import { UsersPasswordsService } from './users-passwords.service' |
||||
import { UsersService } from './users.service' |
||||
|
||||
export const USERS_SERVICES = [UsersPasswordsService] |
||||
|
||||
export { UsersPasswordsService, UsersService } |
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
import { Inject, Injectable } from '@nestjs/common' |
||||
import * as bcrypt from 'bcryptjs' |
||||
import * as randomstring from 'randomstring' |
||||
import { Repository } from 'typeorm' |
||||
import { PASSWORD_HASH_SALT } from '../consts' |
||||
|
||||
@Injectable() |
||||
export class UsersPasswordsService { |
||||
private readonly saltRounds = 10 |
||||
|
||||
@Inject(PASSWORD_HASH_SALT) |
||||
private localHashSalt: string |
||||
|
||||
// public async compareUserPasswords(userId: number, password: string) {
|
||||
// const user = await this.usersRepository.findOne({id: userId})
|
||||
// return this.comparePass(password, user.passwordSalt, user.password)
|
||||
// }
|
||||
|
||||
// public async changeUserPassword(userId: number, newPassword: string): Promise<void> {
|
||||
// const user = await this.usersRepository.findOne({id: userId})
|
||||
// user.password = await this.hashPassword(newPassword, user.passwordSalt)
|
||||
// await this.usersRepository.save(user)
|
||||
// }
|
||||
|
||||
public async hashPassword(password: string, salt: string): Promise<string> { |
||||
return bcrypt.hash(this.getSalt(salt) + password, this.saltRounds) |
||||
} |
||||
|
||||
private async comparePass(password: string, salt: string, hash: string): Promise<boolean> { |
||||
return await bcrypt.compare(this.getSalt(salt) + password, hash) |
||||
} |
||||
|
||||
public createUserSalt(): string { |
||||
return randomstring.generate(10) |
||||
} |
||||
|
||||
private getSalt(userSalt: string): string { |
||||
return this.localHashSalt + userSalt |
||||
} |
||||
} |
@ -1,23 +1,40 @@
@@ -1,23 +1,40 @@
|
||||
import { Injectable } from '@nestjs/common' |
||||
import { Inject, Injectable } from '@nestjs/common' |
||||
import { Users } from 'src/core' |
||||
import { UserCreator } from '../classes/user-creator' |
||||
import { USERS_REPOSITORY } from '../consts' |
||||
import { IUsersRepository } from '../interfaces' |
||||
import { UsersPasswordsService } from './users-passwords.service' |
||||
|
||||
@Injectable() |
||||
export class UsersService { |
||||
/** |
||||
* Метод для отримання користувача по його ідентифікатору |
||||
* @id Ідентифікатор користувача |
||||
* @returns Обект користувача |
||||
*/ |
||||
public async getUser(id: number): Promise<any> { |
||||
const userCreator = new UserCreator() |
||||
export class UsersService implements Users.IUsersService { |
||||
@Inject(USERS_REPOSITORY) usersRepository: IUsersRepository |
||||
|
||||
userCreator.setData({ |
||||
name: 'Vitalik', |
||||
email: 'ebas@mail.ru', |
||||
constructor(private readonly usersPasswordsService: UsersPasswordsService) {} |
||||
|
||||
onModuleInit() { |
||||
this.save({ |
||||
email: 'test@email.ru', |
||||
firstName: 'asdas', |
||||
lastName: 'asdas', |
||||
surname: 'asdas', |
||||
dateOfBirth: new Date().toString(), |
||||
role: Users.Role.User, |
||||
phoneNumber: '+38098071797 0', |
||||
password: '123qqq', |
||||
position: 'helperdo', |
||||
}) |
||||
} |
||||
|
||||
public async save(payload: Users.SaveUserPaylod) { |
||||
const passwordSalt = this.usersPasswordsService.createUserSalt() |
||||
payload.password = await this.usersPasswordsService.hashPassword( |
||||
payload.password, |
||||
passwordSalt, |
||||
) |
||||
|
||||
const user = await userCreator.save() |
||||
const userCreator = new UserCreator({ ...payload, passwordSalt }) |
||||
|
||||
return user |
||||
console.log(await userCreator.setRepositories(this.usersRepository).run()) |
||||
return 1 |
||||
} |
||||
} |
||||
|
@ -1,24 +1,39 @@
@@ -1,24 +1,39 @@
|
||||
import { DynamicModule, Module } from '@nestjs/common' |
||||
import { UsersService } from './services/users.service' |
||||
import { provideEntity } from 'src/libs' |
||||
import { PASSWORD_HASH_SALT, USERS_REPOSITORY } from './consts' |
||||
import { User } from './entities' |
||||
import { UsersModuleOptions } from './interfaces' |
||||
import { UsersPasswordsService, UsersService } from './services' |
||||
|
||||
@Module({}) |
||||
export class UsersModule { |
||||
static options: any |
||||
static options: UsersModuleOptions |
||||
|
||||
static forRoot(options: any): DynamicModule { |
||||
static getProviders() { |
||||
return [ |
||||
UsersService, |
||||
UsersPasswordsService, |
||||
{ |
||||
provide: PASSWORD_HASH_SALT, |
||||
useValue: UsersModule.options.passwordHashSalt, |
||||
}, |
||||
provideEntity(USERS_REPOSITORY, User), |
||||
] |
||||
} |
||||
|
||||
static forRoot(options: UsersModuleOptions): DynamicModule { |
||||
UsersModule.options = options |
||||
|
||||
return { |
||||
module: UsersModule, |
||||
providers: [UsersService], |
||||
providers: UsersModule.getProviders(), |
||||
} |
||||
} |
||||
|
||||
static forFeature(): DynamicModule { |
||||
console.log(UsersModule.options) |
||||
return { |
||||
module: UsersModule, |
||||
providers: [UsersService], |
||||
providers: UsersModule.getProviders(), |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,28 +1,14 @@
@@ -1,28 +1,14 @@
|
||||
import { DynamicModule, Global, Module } from '@nestjs/common'; |
||||
import { UsersModule } from 'src/domain/users/users.module'; |
||||
import { ConnectionOptions, createConnection, EntitySchema } from 'typeorm'; |
||||
import { DynamicModule, Global, Module } from '@nestjs/common' |
||||
import { TypeOrmModule } from '@nestjs/typeorm' |
||||
import { ConnectionOptions } from 'typeorm' |
||||
|
||||
@Global() |
||||
@Module({}) |
||||
export class DatabaseModule { |
||||
static forRoot( |
||||
options: Partial<ConnectionOptions>, |
||||
entities: EntitySchema[], |
||||
): DynamicModule { |
||||
static forRoot(options: Partial<ConnectionOptions>, entities: any[]): DynamicModule { |
||||
return { |
||||
module: DatabaseModule, |
||||
imports: [UsersModule.forFeature()], |
||||
providers: [ |
||||
{ |
||||
provide: 'DATABASE_CONNECTION', |
||||
useFactory: async () => { |
||||
return await createConnection({ |
||||
...options, |
||||
entities, |
||||
} as ConnectionOptions); |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
imports: [TypeOrmModule.forRoot({ ...options, entities })], |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,9 +1,17 @@
@@ -1,9 +1,17 @@
|
||||
import { Connection } from 'typeorm' |
||||
|
||||
export const getRepositoryHelper = (name, entity) => { |
||||
export const provideEntity = (name, entity) => { |
||||
return { |
||||
provide: name, |
||||
useFactory: (connection: Connection) => connection.getRepository(entity), |
||||
inject: ['DATABASE_CONNECTION'], |
||||
inject: [Connection], |
||||
} |
||||
} |
||||
|
||||
export const provideCustomRepository = (name, repo) => { |
||||
return { |
||||
provide: name, |
||||
useFactory: (connection: Connection) => connection.getCustomRepository(repo), |
||||
inject: [Connection], |
||||
} |
||||
} |
||||
|
@ -1,12 +1,8 @@
@@ -1,12 +1,8 @@
|
||||
import { NestFactory } from '@nestjs/core'; |
||||
import { AppModule } from './app.module'; |
||||
|
||||
import * as dotenv from 'dotenv'; |
||||
|
||||
dotenv.config(); |
||||
import { NestFactory } from '@nestjs/core' |
||||
import { AppModule } from './app.module' |
||||
|
||||
async function bootstrap() { |
||||
const app = await NestFactory.create(AppModule); |
||||
await app.listen(3000); |
||||
const app = await NestFactory.create(AppModule) |
||||
await app.listen(3000) |
||||
} |
||||
bootstrap(); |
||||
bootstrap() |
||||
|
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
export const getEnv = (name: string): string => { |
||||
const value = process.env[name] |
||||
|
||||
if (value === undefined || value === null) throw new Error('Not found env var: ' + name) |
||||
|
||||
return value |
||||
} |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
export * from './get-env.helpers' |
||||
export * from './phone-number.helpers' |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
import PhoneNumber from 'awesome-phonenumber' |
||||
|
||||
export const formatPhoneNumber = (phoneNumber: string) => { |
||||
console.log( |
||||
phoneNumber, |
||||
new PhoneNumber(phoneNumber), |
||||
new PhoneNumber(phoneNumber).getNumber('e164'), |
||||
) |
||||
return new PhoneNumber(phoneNumber).getNumber('e164') |
||||
} |
Loading…
Reference in new issue