Browse Source

FEATURE | Users module init

merge-requests/1/merge
Vitalik 3 years ago
parent
commit
4e49578585
  1. 29
      Dockerfile
  2. 68
      docker-compose.yml
  3. 202
      documentation/classes/CustomExeption.html
  4. 223
      documentation/classes/User.html
  5. 215
      documentation/classes/UserAlreadyExistException.html
  6. 467
      documentation/classes/UserCreator.html
  7. 177
      documentation/coverage.html
  8. 13
      documentation/dependencies.html
  9. 2
      documentation/images/coverage-badge-documentation.svg
  10. BIN
      documentation/images/logo.png
  11. 5
      documentation/index.html
  12. 610
      documentation/injectables/UsersPasswordsService.html
  13. 43
      documentation/injectables/UsersService.html
  14. 5
      documentation/interfaces/IDatabaseAsyncModuleParams.html
  15. 338
      documentation/interfaces/IUsersService.html
  16. 709
      documentation/interfaces/Info.html
  17. 681
      documentation/interfaces/SaveUserPaylod.html
  18. 330
      documentation/interfaces/Service.html
  19. 529
      documentation/interfaces/UserModel.html
  20. 203
      documentation/interfaces/UsersModuleOptions.html
  21. 31
      documentation/js/menu-wc.js
  22. 2
      documentation/js/menu-wc_es5.js
  23. 4
      documentation/js/search/search_index.js
  24. 51
      documentation/miscellaneous/enumerations.html
  25. 5
      documentation/miscellaneous/functions.html
  26. 141
      documentation/miscellaneous/typealiases.html
  27. 226
      documentation/miscellaneous/variables.html
  28. 5
      documentation/modules.html
  29. 8
      documentation/modules/AppModule.html
  30. 25
      documentation/modules/DatabaseModule.html
  31. 86
      documentation/modules/UsersModule.html
  32. 11
      documentation/overview.html
  33. 10
      ecosystem.config.js
  34. BIN
      logo.png
  35. 195
      package-lock.json
  36. 17
      package.json
  37. 3
      src/app.module.ts
  38. 3
      src/config/entities.config.ts
  39. 13
      src/config/index.ts
  40. 3
      src/core/exeptions/custom.exeptions.ts
  41. 1
      src/core/exeptions/index.ts
  42. 3
      src/core/exeptions/users.exeptions.ts
  43. 1
      src/core/index.ts
  44. 66
      src/core/namespaces/users.namespace.ts
  45. 1
      src/domain/index.ts
  46. 20
      src/domain/sessions/sessions.module.ts
  47. 70
      src/domain/users/classes/user-creator.ts
  48. 4
      src/domain/users/consts/index.ts
  49. 15
      src/domain/users/entities/user.entity.ts
  50. 2
      src/domain/users/interfaces/index.ts
  51. 5
      src/domain/users/interfaces/users-db.interfaces.ts
  52. 3
      src/domain/users/interfaces/users-module-options.interface.ts
  53. 6
      src/domain/users/services/index.ts
  54. 40
      src/domain/users/services/users-passwords.service.ts
  55. 45
      src/domain/users/services/users.service.ts
  56. 27
      src/domain/users/users.module.ts
  57. 26
      src/libs/database/database.module.ts
  58. 12
      src/libs/database/helpers/get-repository.helper.ts
  59. 14
      src/main.ts
  60. 7
      src/shared/helpers/get-env.helpers.ts
  61. 2
      src/shared/helpers/index.ts
  62. 10
      src/shared/helpers/phone-number.helpers.ts
  63. 1
      src/shared/index.ts

29
Dockerfile

@ -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

68
docker-compose.yml

@ -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;
"

202
documentation/classes/CustomExeption.html

@ -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>

223
documentation/classes/User.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -66,15 +67,15 @@ @@ -66,15 +67,15 @@
<p class="comment">
<h3>Extends</h3>
<h3>Implements</h3>
</p>
<p class="comment">
<code>BaseEntity</code>
<code></code>
</p>
<section>
<h3 id="index">Index</h3>
<table class="table table-sm table-bordered index-table">
@ -87,9 +88,24 @@ @@ -87,9 +88,24 @@
<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>
@ -109,6 +125,41 @@ @@ -109,6 +125,41 @@
<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">
<span ><b>email</b></span>
<a href="#email"><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>
@Column({type: &#x27;varchar&#x27;, nullable: false, unique: true})<br />
</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/domain/users/entities/user.entity.ts:13</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
@ -137,7 +188,147 @@ @@ -137,7 +188,147 @@
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="6" class="link-to-prism">src/domain/users/entities/user.entity.ts:6</a></div>
<div class="io-line">Defined in <a href="" data-line="7" class="link-to-prism">src/domain/users/entities/user.entity.ts:7</a></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">
<span ><b>password</b></span>
<a href="#password"><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>
@Column({type: &#x27;varchar&#x27;, nullable: false, select: false})<br />
</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="19" class="link-to-prism">src/domain/users/entities/user.entity.ts:19</a></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">
<span ><b>passwordSalt</b></span>
<a href="#passwordSalt"><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>
@Column({type: &#x27;varchar&#x27;, nullable: false, select: false})<br />
</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/domain/users/entities/user.entity.ts:22</a></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">
<span ><b>phoneNumber</b></span>
<a href="#phoneNumber"><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>
@Column({type: &#x27;varchar&#x27;, nullable: false, unique: true})<br />
</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="16" class="link-to-prism">src/domain/users/entities/user.entity.ts:16</a></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">
<span ><b>role</b></span>
<a href="#role"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../classes/User.html" target="_self" >Users.Role</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<b>Decorators : </b>
<br />
<code>
@Column({type: &#x27;char&#x27;, default: undefined, nullable: false})<br />
</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="10" class="link-to-prism">src/domain/users/entities/user.entity.ts:10</a></div>
</td>
</tr>
@ -156,12 +347,28 @@ @@ -156,12 +347,28 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { BaseEntity, Entity, PrimaryGeneratedColumn } from &#x27;typeorm&#x27;
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Users } from &#x27;src/core&#x27;
import { Column, Entity, PrimaryGeneratedColumn } from &#x27;typeorm&#x27;
@Entity(&#x27;users&#x27;)
export class User extends BaseEntity {
export class User implements Users.UserModel {
@PrimaryGeneratedColumn()
id: number
@Column({ type: &#x27;char&#x27;, default: Users.Role.User, nullable: false })
role: Users.Role
@Column({ type: &#x27;varchar&#x27;, nullable: false, unique: true })
email: string
@Column({ type: &#x27;varchar&#x27;, nullable: false, unique: true })
phoneNumber: string
@Column({ type: &#x27;varchar&#x27;, nullable: false, select: false })
password: string
@Column({ type: &#x27;varchar&#x27;, nullable: false, select: false })
passwordSalt: string
}
</code></pre>
</div>

215
documentation/classes/UserAlreadyExistException.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 &#x27;./custom.exeptions&#x27;
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>

467
documentation/classes/UserCreator.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -81,6 +82,10 @@ @@ -81,6 +82,10 @@
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<span class="modifier">Private</span>
<a href="#infoRepository" >infoRepository</a>
</li>
<li>
<span class="modifier">Private</span>
<a href="#payload" >payload</a>
@ -101,19 +106,37 @@ @@ -101,19 +106,37 @@
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<span class="modifier">Private</span>
<span class="modifier">Async</span>
<a href="#createUser" >createUser</a>
</li>
<li>
<span class="modifier">Public</span>
<span class="modifier">Async</span>
<a href="#save" >save</a>
<a href="#go" >go</a>
</li>
<li>
<span class="modifier">Private</span>
<a href="#onError" >onError</a>
</li>
<li>
<span class="modifier">Private</span>
<a href="#preparePayload" >preparePayload</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#setData" >setData</a>
<a href="#setPaylod" >setPaylod</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#setRepository" >setRepository</a>
</li>
<li>
<span class="modifier">Private</span>
<span class="modifier">Async</span>
<a href="#validate" >validate</a>
</li>
</ul>
</td>
</tr>
@ -126,12 +149,87 @@ @@ -126,12 +149,87 @@
</table>
</section>
<section>
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(payload: <a href="../interfaces/SaveUserPaylod.html" target="_self">Users.SaveUserPaylod</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="8" class="link-to-prism">src/domain/users/classes/user-creator.ts:8</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div>
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>payload</td>
<td>
<code><a href="../interfaces/SaveUserPaylod.html" target="_self" >Users.SaveUserPaylod</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</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="infoRepository"></a>
<span class="name">
<span class="modifier">Private</span>
<span ><b>infoRepository</b></span>
<a href="#infoRepository"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/Info.html" target="_self" >Repository&lt;Users.Info&gt;</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="7" class="link-to-prism">src/domain/users/classes/user-creator.ts:7</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
@ -146,13 +244,13 @@ @@ -146,13 +244,13 @@
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/UserPaylod.html" target="_self" >UserPaylod</a></code>
<i>Type : </i> <code><a href="../interfaces/SaveUserPaylod.html" target="_self" >Users.SaveUserPaylod</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="10" class="link-to-prism">src/domain/users/classes/user-creator.ts:10</a></div>
<div class="io-line">Defined in <a href="" data-line="8" class="link-to-prism">src/domain/users/classes/user-creator.ts:8</a></div>
</td>
</tr>
@ -173,13 +271,13 @@ @@ -173,13 +271,13 @@
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/UserPaylod.html" target="_self" >Repository&lt;UserPaylod&gt;</a></code>
<i>Type : </i> <code><a href="../interfaces/UserModel.html" target="_self" >Repository&lt;Users.UserModel&gt;</a></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/classes/user-creator.ts:9</a></div>
<div class="io-line">Defined in <a href="" data-line="6" class="link-to-prism">src/domain/users/classes/user-creator.ts:6</a></div>
</td>
</tr>
@ -197,27 +295,67 @@ @@ -197,27 +295,67 @@
<tbody>
<tr>
<td class="col-md-4">
<a name="save"></a>
<a name="createUser"></a>
<span class="name">
<span class="modifier">Private</span>
<span class="modifier">Async</span>
<span ><b>createUser</b></span>
<a href="#createUser"><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>createUser()</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/classes/user-creator.ts:37</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="go"></a>
<span class="name">
<span class="modifier">Public</span>
<span class="modifier">Async</span>
<span ><b>save</b></span>
<a href="#save"><span class="icon ion-ios-link"></span></a>
<span ><b>go</b></span>
<a href="#go"><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>save()</code>
<code>go()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="21"
class="link-to-prism">src/domain/users/classes/user-creator.ts:21</a></div>
<div class="io-line">Defined in <a href="" data-line="55"
class="link-to-prism">src/domain/users/classes/user-creator.ts:55</a></div>
</td>
</tr>
@ -237,26 +375,166 @@ @@ -237,26 +375,166 @@
<tbody>
<tr>
<td class="col-md-4">
<a name="setData"></a>
<a name="onError"></a>
<span class="name">
<span class="modifier">Private</span>
<span ><b>onError</b></span>
<a href="#onError"><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>onError(error: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="32"
class="link-to-prism">src/domain/users/classes/user-creator.ts:32</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>error</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</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="preparePayload"></a>
<span class="name">
<span class="modifier">Private</span>
<span ><b>preparePayload</b></span>
<a href="#preparePayload"><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>preparePayload(payload: <a href="../interfaces/SaveUserPaylod.html" target="_self">Users.SaveUserPaylod</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/classes/user-creator.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>payload</td>
<td>
<code><a href="../interfaces/SaveUserPaylod.html" target="_self" >Users.SaveUserPaylod</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/SaveUserPaylod.html" target="_self" >Users.SaveUserPaylod</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="setPaylod"></a>
<span class="name">
<span class="modifier">Public</span>
<span ><b>setData</b></span>
<a href="#setData"><span class="icon ion-ios-link"></span></a>
<span ><b>setPaylod</b></span>
<a href="#setPaylod"><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>setData(paylod: <a href="../interfaces/UserPaylod.html" target="_self">UserPaylod</a>)</code>
<code>setPaylod(payload: <a href="../interfaces/SaveUserPaylod.html" target="_self">Users.SaveUserPaylod</a>)</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/classes/user-creator.ts:12</a></div>
<div class="io-line">Defined in <a href="" data-line="46"
class="link-to-prism">src/domain/users/classes/user-creator.ts:46</a></div>
</td>
</tr>
@ -276,9 +554,9 @@ @@ -276,9 +554,9 @@
</thead>
<tbody>
<tr>
<td>paylod</td>
<td>payload</td>
<td>
<code><a href="../interfaces/UserPaylod.html" target="_self" >UserPaylod</a></code>
<code><a href="../interfaces/SaveUserPaylod.html" target="_self" >Users.SaveUserPaylod</a></code>
</td>
<td>
@ -318,15 +596,15 @@ @@ -318,15 +596,15 @@
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>setRepository(repository: <a href="../interfaces/UserPaylod.html" target="_self">Repository&lt;UserPaylod&gt;</a>)</code>
<code>setRepository(repository: <a href="../interfaces/UserModel.html" target="_self">Repository&lt;Users.UserModel&gt;</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="16"
class="link-to-prism">src/domain/users/classes/user-creator.ts:16</a></div>
<div class="io-line">Defined in <a href="" data-line="50"
class="link-to-prism">src/domain/users/classes/user-creator.ts:50</a></div>
</td>
</tr>
@ -348,7 +626,7 @@ @@ -348,7 +626,7 @@
<tr>
<td>repository</td>
<td>
<code><a href="../interfaces/UserPaylod.html" target="_self" >Repository&lt;UserPaylod&gt;</a></code>
<code><a href="../interfaces/UserModel.html" target="_self" >Repository&lt;Users.UserModel&gt;</a></code>
</td>
<td>
@ -368,6 +646,77 @@ @@ -368,6 +646,77 @@
</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="validate"></a>
<span class="name">
<span class="modifier">Private</span>
<span class="modifier">Async</span>
<span ><b>validate</b></span>
<a href="#validate"><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>validate(payload: <a href="../interfaces/SaveUserPaylod.html" target="_self">Users.SaveUserPaylod</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="14"
class="link-to-prism">src/domain/users/classes/user-creator.ts:14</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>payload</td>
<td>
<code><a href="../interfaces/SaveUserPaylod.html" target="_self" >Users.SaveUserPaylod</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
@ -383,28 +732,70 @@ @@ -383,28 +732,70 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Repository } from &#x27;typeorm&#x27;
interface UserPaylod {
name: string
email: string
}
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { UserAlreadyExistException, Users } from &#x27;src/core&#x27;
import { formatPhoneNumber } from &#x27;src/shared&#x27;
import { Repository } from &#x27;typeorm&#x27;
export class UserCreator {
private userRepository: Repository&lt;UserPaylod&gt;
private payload: UserPaylod
private userRepository: Repository&lt;Users.UserModel&gt;
private infoRepository: Repository&lt;Users.Info&gt;
private payload: Users.SaveUserPaylod
constructor(payload: Users.SaveUserPaylod) {
this.setPaylod(payload)
}
private async validate(payload: Users.SaveUserPaylod) {
const existUser &#x3D; await this.userRepository
.createQueryBuilder(&#x27;it&#x27;)
.select(&#x27;it.id&#x27;)
.where(&#x27;it.email &#x3D; :email&#x27;, { email: payload.email })
.orWhere(&#x27;it.phoneNumber &#x3D; :phoneNumber&#x27;, { phoneNumber: payload.phoneNumber })
.getOne()
public setData(paylod: UserPaylod) {
this.payload &#x3D; paylod
if (existUser) throw new UserAlreadyExistException()
}
private preparePayload(payload: Users.SaveUserPaylod): Users.SaveUserPaylod {
return {
...payload,
phoneNumber: formatPhoneNumber(payload.phoneNumber),
}
}
private onError(error: any) {
console.log(&#x27;UserCreator: Error: &#x27;, error)
if (error.isCustom) throw error
}
private async createUser() {
await this.userRepository.insert({
email: this.payload.email,
password: this.payload.password,
passwordSalt: this.payload.passwordSalt,
phoneNumber: this.payload.phoneNumber,
})
}
public setPaylod(payload: Users.SaveUserPaylod) {
this.payload &#x3D; this.preparePayload(payload)
return this
}
public setRepository(repository: Repository&lt;UserPaylod&gt;) {
public setRepository(repository: Repository&lt;Users.UserModel&gt;) {
this.userRepository &#x3D; repository
return this
}
public async save() {
public async go() {
try {
if (!this.userRepository || !this.payload) throw new Error(&#x27;User creator not prepared&#x27;)
await this.validate(this.payload)
return this.payload
} catch (e) {
this.onError(e)
}
}
}
</code></pre>

177
documentation/coverage.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="./" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -101,25 +102,73 @@ @@ -101,25 +102,73 @@
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./classes/CustomExeption.html">src/core/exeptions/custom.exeptions.ts</a>
</td>
<td>class</td>
<td>CustomExeption</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/2)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./classes/UserAlreadyExistException.html">src/core/exeptions/users.exeptions.ts</a>
</td>
<td>class</td>
<td>UserAlreadyExistException</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/2)</span>
</td>
</tr>
<tr class="very-good">
<td>
<!-- miscellaneous -->
<a href="./interfaces/IUser.html">src/core/interfaces/entities/user.interface.ts</a>
<a href="./interfaces/Info.html">src/core/namespaces/users.namespace.ts</a>
</td>
<td>interface</td>
<td>IUser</td>
<td align="right" data-sort="85">
<span class="coverage-percent">85 %</span>
<span class="coverage-count">(6/7)</span>
<td>Info</td>
<td align="right" data-sort="100">
<span class="coverage-percent">100 %</span>
<span class="coverage-count">(11/11)</span>
</td>
</tr>
<tr class="medium">
<td>
<!-- miscellaneous -->
<a href="./interfaces/IUsersService.html">src/core/namespaces/users.namespace.ts</a>
</td>
<td>interface</td>
<td>IUsersService</td>
<td align="right" data-sort="50">
<span class="coverage-percent">50 %</span>
<span class="coverage-count">(1/2)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/SaveUserPaylod.html">src/core/namespaces/users.namespace.ts</a>
</td>
<td>interface</td>
<td>SaveUserPaylod</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/12)</span>
</td>
</tr>
<tr class="very-good">
<td>
<!-- miscellaneous -->
<a href="./interfaces/TUser.html">src/core/namespaces/users.namespace.ts</a>
<a href="./interfaces/UserModel.html">src/core/namespaces/users.namespace.ts</a>
</td>
<td>interface</td>
<td>TUser</td>
<td>UserModel</td>
<td align="right" data-sort="100">
<span class="coverage-percent">100 %</span>
<span class="coverage-count">(7/7)</span>
@ -134,19 +183,43 @@ @@ -134,19 +183,43 @@
<td>UserCreator</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/6)</span>
<span class="coverage-count">(0/12)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/UserPaylod.html">src/domain/users/classes/user-creator.ts</a>
<a href="./miscellaneous/variables.html#PASSWORD_HASH_SALT">src/domain/users/consts/index.ts</a>
</td>
<td>interface</td>
<td>UserPaylod</td>
<td>variable</td>
<td>PASSWORD_HASH_SALT</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./miscellaneous/variables.html#USERS_INFOS_REPOSITORY">src/domain/users/consts/index.ts</a>
</td>
<td>variable</td>
<td>USERS_INFOS_REPOSITORY</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./miscellaneous/variables.html#USERS_REPOSITORY">src/domain/users/consts/index.ts</a>
</td>
<td>variable</td>
<td>USERS_REPOSITORY</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/3)</span>
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
@ -168,11 +241,47 @@ @@ -168,11 +241,47 @@
</td>
<td>class</td>
<td>User</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/7)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/UsersModuleOptions.html">src/domain/users/interfaces/users-module-options.interface.ts</a>
</td>
<td>interface</td>
<td>UsersModuleOptions</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/2)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./miscellaneous/variables.html#USERS_SERVICES">src/domain/users/services/index.ts</a>
</td>
<td>variable</td>
<td>USERS_SERVICES</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./injectables/UsersPasswordsService.html">src/domain/users/services/users-passwords.service.ts</a>
</td>
<td>injectable</td>
<td>UsersPasswordsService</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/7)</span>
</td>
</tr>
<tr class="medium">
<td>
<!-- miscellaneous -->
@ -188,10 +297,22 @@ @@ -188,10 +297,22 @@
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./miscellaneous/variables.html#getRepositoryHelper">src/libs/database/helpers/get-repository.helper.ts</a>
<a href="./miscellaneous/variables.html#provideCustomRepository">src/libs/database/helpers/get-repository.helper.ts</a>
</td>
<td>variable</td>
<td>getRepositoryHelper</td>
<td>provideCustomRepository</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./miscellaneous/variables.html#provideEntity">src/libs/database/helpers/get-repository.helper.ts</a>
</td>
<td>variable</td>
<td>provideEntity</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/1)</span>
@ -221,6 +342,30 @@ @@ -221,6 +342,30 @@
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./miscellaneous/variables.html#getEnv">src/shared/helpers/get-env.helpers.ts</a>
</td>
<td>variable</td>
<td>getEnv</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/1)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./miscellaneous/variables.html#formatPhoneNumber">src/shared/helpers/phone-number.helpers.ts</a>
</td>
<td>variable</td>
<td>formatPhoneNumber</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/1)</span>
</td>
</tr>
</tbody>
</table>

13
documentation/dependencies.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="./" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -56,16 +57,22 @@ @@ -56,16 +57,22 @@
<b>@nestjs/platform-express</b> : ^7.0.0</li>
<li>
<b>@nestjs/typeorm</b> : ^8.0.1</li>
<li>
<b>awesome-phonenumber</b> : ^2.55.0</li>
<li>
<b>dotenv</b> : ^10.0.0</li>
<li>
<b>postgres</b> : ^1.0.2</li>
<b>pg</b> : ^8.7.1</li>
<li>
<b>randomstring</b> : ^1.2.1</li>
<li>
<b>reflect-metadata</b> : ^0.1.13</li>
<li>
<b>rimraf</b> : ^3.0.2</li>
<li>
<b>rxjs</b> : ^6.5.4</li>
<li>
<b>secure-compare</b> : ^3.0.1</li>
<li>
<b>typeorm</b> : ^0.2.36</li>
</ul>

2
documentation/images/coverage-badge-documentation.svg

@ -4,6 +4,6 @@ @@ -4,6 +4,6 @@
<rect id="svg_2" height="20" width="40" y="0" x="92" stroke-width="1.5" stroke="#d8604b" fill="#d8604b" rx="7" ry="7"/>
<rect id="svg_3" height="20" width="22" y="0" x="92" stroke-width="1.5" stroke="#d8604b" fill="#d8604b"/>
<text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="12" id="svg_4" y="14" x="6" stroke-width="0" stroke="#5d5d5d" fill="#ffffff">documentation</text>
<text xml:space="preserve" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-size="12" id="svg_5" y="14" x="112" stroke-width="0" stroke="#5d5d5d" fill="#ffffff" style="text-anchor: middle">18%</text>
<text xml:space="preserve" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-size="12" id="svg_5" y="14" x="112" stroke-width="0" stroke="#5d5d5d" fill="#ffffff" style="text-anchor: middle">12%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 894 B

BIN
documentation/images/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

5
documentation/index.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="./" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>

610
documentation/injectables/UsersPasswordsService.html

@ -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&lt;boolean&gt;</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&lt;string&gt;</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 &#x27;@nestjs/common&#x27;
import * as bcrypt from &#x27;bcryptjs&#x27;
import * as randomstring from &#x27;randomstring&#x27;
import { Repository } from &#x27;typeorm&#x27;
import { PASSWORD_HASH_SALT } from &#x27;../consts&#x27;
@Injectable()
export class UsersPasswordsService {
private readonly saltRounds &#x3D; 10
@Inject(PASSWORD_HASH_SALT)
private localHashSalt: string
// public async compareUserPasswords(userId: number, password: string) {
// const user &#x3D; await this.usersRepository.findOne({id: userId})
// return this.comparePass(password, user.passwordSalt, user.password)
// }
// public async changeUserPassword(userId: number, newPassword: string): Promise&lt;void&gt; {
// const user &#x3D; await this.usersRepository.findOne({id: userId})
// user.password &#x3D; await this.hashPassword(newPassword, user.passwordSalt)
// await this.usersRepository.save(user)
// }
public async hashPassword(password: string, salt: string): Promise&lt;string&gt; {
return bcrypt.hash(this.getSalt(salt) + password, this.saltRounds)
}
private async comparePass(password: string, salt: string, hash: string): Promise&lt;boolean&gt; {
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>

43
documentation/injectables/UsersService.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -80,7 +81,7 @@ @@ -80,7 +81,7 @@
<li>
<span class="modifier">Public</span>
<span class="modifier">Async</span>
<a href="#getUser" >getUser</a>
<a href="#save" >save</a>
</li>
</ul>
</td>
@ -104,27 +105,27 @@ @@ -104,27 +105,27 @@
<tbody>
<tr>
<td class="col-md-4">
<a name="getUser"></a>
<a name="save"></a>
<span class="name">
<span class="modifier">Public</span>
<span class="modifier">Async</span>
<span ><b>getUser</b></span>
<a href="#getUser"><span class="icon ion-ios-link"></span></a>
<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">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>getUser(id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
<code>save(payload: <a href="../interfaces/SaveUserPaylod.html" target="_self">Users.SaveUserPaylod</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="11"
class="link-to-prism">src/domain/users/services/users.service.ts:11</a></div>
<div class="io-line">Defined in <a href="" data-line="12"
class="link-to-prism">src/domain/users/services/users.service.ts:12</a></div>
</td>
</tr>
@ -146,9 +147,9 @@ @@ -146,9 +147,9 @@
</thead>
<tbody>
<tr>
<td>id</td>
<td>payload</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
<code><a href="../interfaces/SaveUserPaylod.html" target="_self" >Users.SaveUserPaylod</a></code>
</td>
<td>
@ -163,7 +164,7 @@ @@ -163,7 +164,7 @@
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>Promise&lt;any&gt;</code>
<b>Returns : </b> <code>unknown</code>
</div>
<div class="io-description">
@ -181,26 +182,18 @@ @@ -181,26 +182,18 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from &#x27;@nestjs/common&#x27;
import { UserCreator } from &#x27;../classes/user-creator&#x27;
import { Users } from &#x27;src/core&#x27;
@Injectable()
export class UsersService {
export class UsersService implements Users.Service {
/**
* Метод для отримання користувача по його ідентифікатору
* @id Ідентифікатор користувача
* @payload - Данні нового користувача {{}}
* @returns Обект користувача
*/
public async getUser(id: number): Promise&lt;any&gt; {
const userCreator &#x3D; new UserCreator()
userCreator.setData({
name: &#x27;Vitalik&#x27;,
email: &#x27;ebas@mail.ru&#x27;,
})
const user &#x3D; await userCreator.save()
return user
public async save(payload: Users.SaveUserPaylod) {
return 1
}
}
</code></pre>

5
documentation/interfaces/IDatabaseAsyncModuleParams.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>

338
documentation/interfaces/IUsersService.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&lt;number&gt;</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 &#x3D; &#x27;a&#x27;,
User &#x3D; &#x27;u&#x27;,
}
/**
* Базовий інтерфейс користувача
*/
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&lt;number&gt;
}
}
</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>

709
documentation/interfaces/Info.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 &#x3D; &#x27;a&#x27;,
User &#x3D; &#x27;u&#x27;,
}
/**
* Базовий інтерфейс користувача
*/
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&lt;number&gt;
}
}
</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>

681
documentation/interfaces/SaveUserPaylod.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 &#x3D; &#x27;a&#x27;,
User &#x3D; &#x27;u&#x27;,
}
/**
* Базовий інтерфейс користувача
*/
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&lt;number&gt;
}
}
</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>

330
documentation/interfaces/Service.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&lt;number&gt;</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 &#x3D; &#x27;a&#x27;,
User &#x3D; &#x27;u&#x27;,
}
/**
* Базовий інтерфейс користувача
*/
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&lt;number&gt;
}
}
</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>

529
documentation/interfaces/UserModel.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 &#x3D; &#x27;a&#x27;,
User &#x3D; &#x27;u&#x27;,
}
/**
* Базовий інтерфейс користувача
*/
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&lt;number&gt;
}
}
</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>

203
documentation/interfaces/UsersModuleOptions.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>

31
documentation/js/menu-wc.js

@ -16,7 +16,9 @@ customElements.define('compodoc-menu', class extends HTMLElement { @@ -16,7 +16,9 @@ customElements.define('compodoc-menu', class extends HTMLElement {
<nav>
<ul class="list">
<li class="title">
<a href="index.html" data-type="index-link">api-taskme documentation</a>
<a href="index.html" data-type="index-link">
<img alt="" class="img-responsive" data-type="compodoc-logo" data-src=images/logo.png>
</a>
</li>
<li class="divider"></li>
@ -70,9 +72,15 @@ customElements.define('compodoc-menu', class extends HTMLElement { @@ -70,9 +72,15 @@ customElements.define('compodoc-menu', class extends HTMLElement {
<span class="icon ion-ios-arrow-down"></span>
</div>
<ul class="links collapse " ${ isNormalMode ? 'id="classes-links"' : 'id="xs-classes-links"' }>
<li class="link">
<a href="classes/CustomExeption.html" data-type="entity-link" >CustomExeption</a>
</li>
<li class="link">
<a href="classes/User.html" data-type="entity-link" >User</a>
</li>
<li class="link">
<a href="classes/UserAlreadyExistException.html" data-type="entity-link" >UserAlreadyExistException</a>
</li>
<li class="link">
<a href="classes/UserCreator.html" data-type="entity-link" >UserCreator</a>
</li>
@ -86,6 +94,9 @@ customElements.define('compodoc-menu', class extends HTMLElement { @@ -86,6 +94,9 @@ customElements.define('compodoc-menu', class extends HTMLElement {
<span class="icon ion-ios-arrow-down"></span>
</div>
<ul class="links collapse " ${ isNormalMode ? 'id="injectables-links"' : 'id="xs-injectables-links"' }>
<li class="link">
<a href="injectables/UsersPasswordsService.html" data-type="entity-link" >UsersPasswordsService</a>
</li>
<li class="link">
<a href="injectables/UsersService.html" data-type="entity-link" >UsersService</a>
</li>
@ -103,13 +114,19 @@ customElements.define('compodoc-menu', class extends HTMLElement { @@ -103,13 +114,19 @@ customElements.define('compodoc-menu', class extends HTMLElement {
<a href="interfaces/IDatabaseAsyncModuleParams.html" data-type="entity-link" >IDatabaseAsyncModuleParams</a>
</li>
<li class="link">
<a href="interfaces/IUser.html" data-type="entity-link" >IUser</a>
<a href="interfaces/Info.html" data-type="entity-link" >Info</a>
</li>
<li class="link">
<a href="interfaces/TUser.html" data-type="entity-link" >TUser</a>
<a href="interfaces/IUsersService.html" data-type="entity-link" >IUsersService</a>
</li>
<li class="link">
<a href="interfaces/UserPaylod.html" data-type="entity-link" >UserPaylod</a>
<a href="interfaces/SaveUserPaylod.html" data-type="entity-link" >SaveUserPaylod</a>
</li>
<li class="link">
<a href="interfaces/UserModel.html" data-type="entity-link" >UserModel</a>
</li>
<li class="link">
<a href="interfaces/UsersModuleOptions.html" data-type="entity-link" >UsersModuleOptions</a>
</li>
</ul>
</li>
@ -135,12 +152,6 @@ customElements.define('compodoc-menu', class extends HTMLElement { @@ -135,12 +152,6 @@ customElements.define('compodoc-menu', class extends HTMLElement {
<li class="chapter">
<a data-type="chapter-link" href="coverage.html"><span class="icon ion-ios-stats"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.app/" target="_blank">
<img data-src="images/compodoc-vectorise.png" class="img-responsive" data-type="compodoc-logo">
</a>
</li>
</ul>
</nav>
`);

2
documentation/js/menu-wc_es5.js

File diff suppressed because one or more lines are too long

4
documentation/js/search/search_index.js

File diff suppressed because one or more lines are too long

51
documentation/miscellaneous/enumerations.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -59,10 +60,7 @@ @@ -59,10 +60,7 @@
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#Role" title="src/core/enums/role.enum.ts" ><b>Role</b>&nbsp;&nbsp;&nbsp;(src/.../role.enum.ts)</a>
</li>
<li>
<a href="#TRole" title="src/core/namespaces/users.namespace.ts" ><b>TRole</b>&nbsp;&nbsp;&nbsp;(src/.../users.namespace.ts)</a>
<a href="#Role" title="src/core/namespaces/users.namespace.ts" ><b>Role</b>&nbsp;&nbsp;&nbsp;(src/.../users.namespace.ts)</a>
</li>
</ul>
</td>
@ -71,7 +69,7 @@ @@ -71,7 +69,7 @@
</table>
</section>
<h3>src/core/enums/role.enum.ts</h3>
<h3>src/core/namespaces/users.namespace.ts</h3>
<section>
<table class="table table-sm table-bordered">
<tbody>
@ -110,45 +108,6 @@ @@ -110,45 +108,6 @@
</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="TRole"></a>
<span class="name "><b>TRole</b><a href="#TRole"><span class="icon ion-ios-link"></span></a></span>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Роль користувача</p>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
&nbsp;Admin
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Value : </i><code>a</code>
</td>
</tr>
<tr>
<td class="col-md-4">
&nbsp;User
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Value : </i><code>u</code>
</td>
</tr>
</tbody>
</table>
</section>

5
documentation/miscellaneous/functions.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>

141
documentation/miscellaneous/typealiases.html

@ -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>&nbsp;&nbsp;&nbsp;(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>

226
documentation/miscellaneous/variables.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -61,18 +62,39 @@ @@ -61,18 +62,39 @@
<li>
<a href="#$config" title="src/config/index.ts" ><b>$config</b>&nbsp;&nbsp;&nbsp;(src/.../index.ts)</a>
</li>
<li>
<a href="#formatPhoneNumber" title="src/shared/helpers/phone-number.helpers.ts" ><b>formatPhoneNumber</b>&nbsp;&nbsp;&nbsp;(src/.../phone-number.helpers.ts)</a>
</li>
<li>
<a href="#getDatabaseConfig" title="src/config/index.ts" ><b>getDatabaseConfig</b>&nbsp;&nbsp;&nbsp;(src/.../index.ts)</a>
</li>
<li>
<a href="#getRepositoryHelper" title="src/libs/database/helpers/get-repository.helper.ts" ><b>getRepositoryHelper</b>&nbsp;&nbsp;&nbsp;(src/.../get-repository.helper.ts)</a>
<a href="#getEnv" title="src/shared/helpers/get-env.helpers.ts" ><b>getEnv</b>&nbsp;&nbsp;&nbsp;(src/.../get-env.helpers.ts)</a>
</li>
<li>
<a href="#imports" title="src/app.module.ts" ><b>imports</b>&nbsp;&nbsp;&nbsp;(src/.../app.module.ts)</a>
</li>
<li>
<a href="#PASSWORD_HASH_SALT" title="src/domain/users/consts/index.ts" ><b>PASSWORD_HASH_SALT</b>&nbsp;&nbsp;&nbsp;(src/.../index.ts)</a>
</li>
<li>
<a href="#provideCustomRepository" title="src/libs/database/helpers/get-repository.helper.ts" ><b>provideCustomRepository</b>&nbsp;&nbsp;&nbsp;(src/.../get-repository.helper.ts)</a>
</li>
<li>
<a href="#provideEntity" title="src/libs/database/helpers/get-repository.helper.ts" ><b>provideEntity</b>&nbsp;&nbsp;&nbsp;(src/.../get-repository.helper.ts)</a>
</li>
<li>
<a href="#USERS_ENTITIES" title="src/domain/users/entities/index.ts" ><b>USERS_ENTITIES</b>&nbsp;&nbsp;&nbsp;(src/.../index.ts)</a>
</li>
<li>
<a href="#USERS_INFOS_REPOSITORY" title="src/domain/users/consts/index.ts" ><b>USERS_INFOS_REPOSITORY</b>&nbsp;&nbsp;&nbsp;(src/.../index.ts)</a>
</li>
<li>
<a href="#USERS_REPOSITORY" title="src/domain/users/consts/index.ts" ><b>USERS_REPOSITORY</b>&nbsp;&nbsp;&nbsp;(src/.../index.ts)</a>
</li>
<li>
<a href="#USERS_SERVICES" title="src/domain/users/services/index.ts" ><b>USERS_SERVICES</b>&nbsp;&nbsp;&nbsp;(src/.../index.ts)</a>
</li>
</ul>
</td>
</tr>
@ -126,7 +148,7 @@ @@ -126,7 +148,7 @@
<i>Default value : </i><code>(): Parameters&lt;typeof DatabaseModule[&#x27;forRoot&#x27;]&gt; &#x3D;&gt; {
return [
{
type: process.env.DATABASE_TYPE as &#x27;postgres&#x27;,
type: &#x27;postgres&#x27;,
host: process.env.DATABASE_HOST,
port: Number(process.env.DATABASE_PORT),
username: process.env.DATABASE_USER,
@ -135,7 +157,7 @@ @@ -135,7 +157,7 @@
synchronize: true,
},
[],
];
]
}</code>
</td>
</tr>
@ -144,27 +166,52 @@ @@ -144,27 +166,52 @@
</tbody>
</table>
</section>
<h3>src/libs/database/helpers/get-repository.helper.ts</h3>
<h3>src/shared/helpers/phone-number.helpers.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getRepositoryHelper"></a>
<a name="formatPhoneNumber"></a>
<span class="name">
<span ><b>getRepositoryHelper</b></span>
<a href="#getRepositoryHelper"><span class="icon ion-ios-link"></span></a>
<span ><b>formatPhoneNumber</b></span>
<a href="#formatPhoneNumber"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>(name, entity) &#x3D;&gt; {
return {
provide: name,
useFactory: (connection: Connection) &#x3D;&gt; connection.getRepository(entity),
inject: [&#x27;DATABASE_CONNECTION&#x27;],
}
<i>Default value : </i><code>(phoneNumber: string) &#x3D;&gt; {
return new PhoneNumber(phoneNumber).getNumber(&#x27;e164&#x27;)
}</code>
</td>
</tr>
</tbody>
</table>
</section>
<h3>src/shared/helpers/get-env.helpers.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getEnv"></a>
<span class="name">
<span ><b>getEnv</b></span>
<a href="#getEnv"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>(name: string): string &#x3D;&gt; {
const value &#x3D; process.env[name]
if (value &#x3D;&#x3D;&#x3D; undefined || value &#x3D;&#x3D;&#x3D; null) throw new Error(&#x27;Not found env var: &#x27; + name)
return value
}</code>
</td>
</tr>
@ -195,13 +242,131 @@ @@ -195,13 +242,131 @@
<tr>
<td class="col-md-4">
<i>Default value : </i><code>[
UsersModule.forRoot(&#x27;some&#x27;),
DatabaseModule.forRoot(...$config.getDatabaseConfig()),
UsersModule.forRoot({ passwordHashSalt: getEnv(&#x27;LOCAL_HASH_SALT&#x27;) }),
]</code>
</td>
</tr>
</tbody>
</table>
</section>
<h3>src/domain/users/consts/index.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="PASSWORD_HASH_SALT"></a>
<span class="name">
<span ><b>PASSWORD_HASH_SALT</b></span>
<a href="#PASSWORD_HASH_SALT"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>Symbol(&#x27;PASSWORD_HASH_SALT&#x27;)</code>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="USERS_INFOS_REPOSITORY"></a>
<span class="name">
<span ><b>USERS_INFOS_REPOSITORY</b></span>
<a href="#USERS_INFOS_REPOSITORY"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>Symbol(&#x27;USERS_INFOS_REPOSITORY&#x27;)</code>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="USERS_REPOSITORY"></a>
<span class="name">
<span ><b>USERS_REPOSITORY</b></span>
<a href="#USERS_REPOSITORY"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>Symbol(&#x27;USERS_REPOSITORY&#x27;)</code>
</td>
</tr>
</tbody>
</table>
</section>
<h3>src/libs/database/helpers/get-repository.helper.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="provideCustomRepository"></a>
<span class="name">
<span ><b>provideCustomRepository</b></span>
<a href="#provideCustomRepository"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>(name, repo) &#x3D;&gt; {
return {
provide: name,
useFactory: (connection: Connection) &#x3D;&gt; connection.getCustomRepository(repo),
inject: [Connection],
}
}</code>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="provideEntity"></a>
<span class="name">
<span ><b>provideEntity</b></span>
<a href="#provideEntity"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>(name, entity) &#x3D;&gt; {
return {
provide: name,
useFactory: (connection: Connection) &#x3D;&gt; connection.getRepository(entity),
inject: [Connection],
}
}</code>
</td>
</tr>
</tbody>
</table>
</section>
@ -231,6 +396,35 @@ @@ -231,6 +396,35 @@
</tr>
</tbody>
</table>
</section>
<h3>src/domain/users/services/index.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="USERS_SERVICES"></a>
<span class="name">
<span ><b>USERS_SERVICES</b></span>
<a href="#USERS_SERVICES"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>[]</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>[UsersPasswordsService]</code>
</td>
</tr>
</tbody>
</table>
</section>

5
documentation/modules.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="./" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>

8
documentation/modules/AppModule.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -153,10 +154,11 @@ @@ -153,10 +154,11 @@
import { $config } from &#x27;./config&#x27;
import { UsersModule } from &#x27;./domain/users/users.module&#x27;
import { DatabaseModule } from &#x27;./libs&#x27;
import { getEnv } from &#x27;./shared&#x27;
const imports &#x3D; [
UsersModule.forRoot(&#x27;some&#x27;),
DatabaseModule.forRoot(...$config.getDatabaseConfig()),
UsersModule.forRoot({ passwordHashSalt: getEnv(&#x27;LOCAL_HASH_SALT&#x27;) }),
]
@Module({ imports })

25
documentation/modules/DatabaseModule.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -94,8 +95,8 @@ @@ -94,8 +95,8 @@
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="8"
class="link-to-prism">src/libs/database/database.module.ts:8</a></div>
<div class="io-line">Defined in <a href="" data-line="7"
class="link-to-prism">src/libs/database/database.module.ts:7</a></div>
</td>
</tr>
@ -159,20 +160,16 @@ @@ -159,20 +160,16 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { DynamicModule, Global, Module } from &#x27;@nestjs/common&#x27;;
import { UsersModule } from &#x27;src/domain/users/users.module&#x27;;
import { ConnectionOptions, createConnection, EntitySchema } from &#x27;typeorm&#x27;;
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { DynamicModule, Global, Module } from &#x27;@nestjs/common&#x27;
import { ConnectionOptions, createConnection, EntitySchema } from &#x27;typeorm&#x27;
@Global()
@Module({})
export class DatabaseModule {
static forRoot(
options: Partial&lt;ConnectionOptions&gt;,
entities: EntitySchema[],
): DynamicModule {
static forRoot(options: Partial&lt;ConnectionOptions&gt;, entities: EntitySchema[]): DynamicModule {
return {
module: DatabaseModule,
imports: [UsersModule.forFeature()],
imports: [],
providers: [
{
provide: &#x27;DATABASE_CONNECTION&#x27;,
@ -180,11 +177,11 @@ export class DatabaseModule { @@ -180,11 +177,11 @@ export class DatabaseModule {
return await createConnection({
...options,
entities,
} as ConnectionOptions);
} as ConnectionOptions)
},
},
],
};
}
}
}
</code></pre>

86
documentation/modules/UsersModule.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="../" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -94,8 +95,8 @@ @@ -94,8 +95,8 @@
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="17"
class="link-to-prism">src/domain/users/users.module.ts:17</a></div>
<div class="io-line">Defined in <a href="" data-line="29"
class="link-to-prism">src/domain/users/users.module.ts:29</a></div>
</td>
</tr>
@ -126,15 +127,15 @@ @@ -126,15 +127,15 @@
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>forRoot(options: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
<code>forRoot(options: <a href="../interfaces/UsersModuleOptions.html" target="_self">UsersModuleOptions</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="8"
class="link-to-prism">src/domain/users/users.module.ts:8</a></div>
<div class="io-line">Defined in <a href="" data-line="21"
class="link-to-prism">src/domain/users/users.module.ts:21</a></div>
</td>
</tr>
@ -156,7 +157,7 @@ @@ -156,7 +157,7 @@
<tr>
<td>options</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
<code><a href="../interfaces/UsersModuleOptions.html" target="_self" >UsersModuleOptions</a></code>
</td>
<td>
@ -176,6 +177,45 @@ @@ -176,6 +177,45 @@
</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="getProviders"></a>
<span class="name">
<span class="modifier">Static</span>
<span ><b>getProviders</b></span>
<a href="#getProviders"><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>getProviders()</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/users.module.ts:12</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code>{}</code>
</div>
</td>
</tr>
@ -187,26 +227,44 @@ @@ -187,26 +227,44 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { DynamicModule, Module } from &#x27;@nestjs/common&#x27;
import { UsersService } from &#x27;./services/users.service&#x27;
import { provideEntity } from &#x27;src/libs&#x27;
import { PASSWORD_HASH_SALT, USERS_REPOSITORY } from &#x27;./consts&#x27;
import { User } from &#x27;./entities&#x27;
import { UsersModuleOptions } from &#x27;./interfaces&#x27;
import { UsersService } from &#x27;./services&#x27;
@Module({})
export class UsersModule {
static options: any
static options: UsersModuleOptions
static getProviders() {
return [
{
provide: PASSWORD_HASH_SALT,
useValue: UsersModule.options.passwordHashSalt,
},
]
}
static forRoot(options: any): DynamicModule {
static forRoot(options: UsersModuleOptions): DynamicModule {
UsersModule.options &#x3D; options
return {
module: UsersModule,
providers: [UsersService],
}
}
static forFeature(): DynamicModule {
console.log(UsersModule.options)
return {
module: UsersModule,
providers: [UsersService],
providers: [
UsersService,
{
provide: PASSWORD_HASH_SALT,
useValue: UsersModule.options.passwordHashSalt,
},
provideEntity(USERS_REPOSITORY, User),
],
}
}
}

11
documentation/overview.html

@ -3,18 +3,19 @@ @@ -3,18 +3,19 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>api-taskme documentation</title>
<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">api-taskme documentation</a>
<a href="./" class="navbar-brand">TaskMe</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
@ -116,7 +117,7 @@ @@ -116,7 +117,7 @@
<div class="card text-center">
<div class="card-block">
<h4 class="card-title"><span class="icon ion-md-arrow-round-down"></span></h4>
<p class="card-text">1 Injectable</p>
<p class="card-text">2 Injectables</p>
</div>
</div>
</div>
@ -124,7 +125,7 @@ @@ -124,7 +125,7 @@
<div class="card text-center">
<div class="card-block">
<h4 class="card-title"><span class="icon ion-ios-paper"></span></h4>
<p class="card-text">2 Classes</p>
<p class="card-text">4 Classes</p>
</div>
</div>
</div>
@ -132,7 +133,7 @@ @@ -132,7 +133,7 @@
<div class="card text-center">
<div class="card-block">
<h4 class="card-title"><span class="icon ion-md-information-circle-outline"></span></h4>
<p class="card-text">4 Interfaces</p>
<p class="card-text">6 Interfaces</p>
</div>
</div>
</div>

10
ecosystem.config.js

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
module.exports = {
apps: [
{
name: 'api',
script: './dist/main.js',
node_args: '-r dotenv/config',
watch: true,
},
],
}

BIN
logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

195
package-lock.json generated

@ -3228,6 +3228,11 @@ @@ -3228,6 +3228,11 @@
"is-string": "^1.0.5"
}
},
"array-uniq": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz",
"integrity": "sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0="
},
"array-unique": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
@ -3334,6 +3339,11 @@ @@ -3334,6 +3339,11 @@
"integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
"dev": true
},
"awesome-phonenumber": {
"version": "2.55.0",
"resolved": "https://registry.npmjs.org/awesome-phonenumber/-/awesome-phonenumber-2.55.0.tgz",
"integrity": "sha512-lSq5t4v6pJR+qzWqnSdac2TX20CD5ggVBD8cNL34rgJ+0hVCx+McPgQNLDxdNjiaGeYWrUxscV3BU4K/Tm/JdQ=="
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
@ -3793,6 +3803,11 @@ @@ -3793,6 +3803,11 @@
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"buffer-writer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw=="
},
"busboy": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz",
@ -4813,6 +4828,16 @@ @@ -4813,6 +4828,16 @@
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
"dev": true
},
"env-cmd": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/env-cmd/-/env-cmd-10.1.0.tgz",
"integrity": "sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA==",
"dev": true,
"requires": {
"commander": "^4.0.0",
"cross-spawn": "^7.0.0"
}
},
"errno": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
@ -6410,6 +6435,23 @@ @@ -6410,6 +6435,23 @@
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0",
"through": "^2.3.6"
},
"dependencies": {
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"inside": {
@ -9056,6 +9098,11 @@ @@ -9056,6 +9098,11 @@
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
"dev": true
},
"packet-reader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
},
"pako": {
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
@ -9203,6 +9250,60 @@ @@ -9203,6 +9250,60 @@
}
}
},
"pg": {
"version": "8.7.1",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.7.1.tgz",
"integrity": "sha512-7bdYcv7V6U3KAtWjpQJJBww0UEsWuh4yQ/EjNf2HeO/NnvKjpvhEIe/A/TleP6wtmSKnUnghs5A9jUoK6iDdkA==",
"requires": {
"buffer-writer": "2.0.0",
"packet-reader": "1.0.0",
"pg-connection-string": "^2.5.0",
"pg-pool": "^3.4.1",
"pg-protocol": "^1.5.0",
"pg-types": "^2.1.0",
"pgpass": "1.x"
}
},
"pg-connection-string": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz",
"integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ=="
},
"pg-int8": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="
},
"pg-pool": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.4.1.tgz",
"integrity": "sha512-TVHxR/gf3MeJRvchgNHxsYsTCHQ+4wm3VIHSS19z8NC0+gioEhq1okDY1sm/TYbfoP6JLFx01s0ShvZ3puP/iQ=="
},
"pg-protocol": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz",
"integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ=="
},
"pg-types": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
"requires": {
"pg-int8": "1.0.1",
"postgres-array": "~2.0.0",
"postgres-bytea": "~1.0.0",
"postgres-date": "~1.0.4",
"postgres-interval": "^1.1.0"
}
},
"pgpass": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz",
"integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==",
"requires": {
"split2": "^3.1.1"
}
},
"picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
@ -9260,10 +9361,28 @@ @@ -9260,10 +9361,28 @@
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
"dev": true
},
"postgres": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/postgres/-/postgres-1.0.2.tgz",
"integrity": "sha512-zeLgt42KSUNgX/uvo+gbVxTAYwgSY6MIKuU/a8YWuObX4rtGuKrVWopvEAqIAPSO0FeHS1TsSKnqPjoufPy8NA=="
"postgres-array": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA=="
},
"postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
},
"postgres-date": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q=="
},
"postgres-interval": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
"requires": {
"xtend": "^4.0.0"
}
},
"prelude-ls": {
"version": "1.2.1",
@ -9384,6 +9503,22 @@ @@ -9384,6 +9503,22 @@
"safe-buffer": "^5.1.0"
}
},
"randomstring": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/randomstring/-/randomstring-1.2.1.tgz",
"integrity": "sha512-eMnfell9XuU3jfCx3f4xCaFAt0YMFPZhx9R3PSStmLarDKg5j5vivqKhf/8pvG+VX/YkxsckHK/VPUrKa5V07A==",
"requires": {
"array-uniq": "1.0.2",
"randombytes": "2.0.3"
},
"dependencies": {
"randombytes": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz",
"integrity": "sha1-Z0yZdgkBw8QRJ3GjHlIdw0nMCew="
}
}
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
@ -9694,17 +9829,17 @@ @@ -9694,17 +9829,17 @@
}
},
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.3.0.tgz",
"integrity": "sha512-p2yuGIg9S1epc3vrjKf6iVb3RCaAYjYskkO+jHIaV0IjOPlJop4UnodOoFb2xeNwlguqLYvGw1b1McillYb5Gw==",
"requires": {
"tslib": "^1.9.0"
"tslib": "~2.1.0"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz",
"integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A=="
}
}
},
@ -9996,6 +10131,11 @@ @@ -9996,6 +10131,11 @@
"get-assigned-identifiers": "^1.1.0"
}
},
"secure-compare": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
"integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM="
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
@ -10459,6 +10599,39 @@ @@ -10459,6 +10599,39 @@
"extend-shallow": "^3.0.0"
}
},
"split2": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
"integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
"requires": {
"readable-stream": "^3.0.0"
},
"dependencies": {
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"requires": {
"safe-buffer": "~5.2.0"
}
}
}
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",

17
package.json

@ -9,27 +9,31 @@ @@ -9,27 +9,31 @@
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start": "pm2-runtime start ecosystem.config.js",
"start:dev": " nest build --watch --webpack --webpackPath webpack-hmr.config.js",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"start:prod": "env-cmd -f .env node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
"test:e2e": "jest --config ./test/jest-e2e.json",
"docs": "npx @compodoc/compodoc -p tsconfig.json -s --theme laravel --hideGenerator --name TaskMe --customLogo ./logo.png"
},
"dependencies": {
"@nestjs/common": "^7.0.0",
"@nestjs/core": "^7.0.0",
"@nestjs/platform-express": "^7.0.0",
"@nestjs/typeorm": "^8.0.1",
"awesome-phonenumber": "^2.55.0",
"dotenv": "^10.0.0",
"postgres": "^1.0.2",
"pg": "^8.7.1",
"randomstring": "^1.2.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.5.4",
"rxjs": "^7.3.0",
"secure-compare": "^3.0.1",
"typeorm": "^0.2.36"
},
"devDependencies": {
@ -43,6 +47,7 @@ @@ -43,6 +47,7 @@
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "3.9.1",
"@typescript-eslint/parser": "3.9.1",
"env-cmd": "^10.1.0",
"eslint": "7.7.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",

3
src/app.module.ts

@ -2,10 +2,11 @@ import { Module } from '@nestjs/common' @@ -2,10 +2,11 @@ import { Module } from '@nestjs/common'
import { $config } from './config'
import { UsersModule } from './domain/users/users.module'
import { DatabaseModule } from './libs'
import { getEnv } from './shared'
const imports = [
UsersModule.forRoot('some'),
DatabaseModule.forRoot(...$config.getDatabaseConfig()),
UsersModule.forRoot({ passwordHashSalt: getEnv('LOCAL_HASH_SALT') }),
]
@Module({ imports })

3
src/config/entities.config.ts

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
import { USERS_ENTITIES } from 'src/domain/users/entities'
export const ENTITIES = [...USERS_ENTITIES]

13
src/config/index.ts

@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
import { DatabaseModule } from 'src/libs';
import { DatabaseModule } from 'src/libs'
import { ENTITIES } from './entities.config'
const getDatabaseConfig = (): Parameters<typeof DatabaseModule['forRoot']> => {
return [
{
type: process.env.DATABASE_TYPE as 'postgres',
type: 'postgres',
host: process.env.DATABASE_HOST,
port: Number(process.env.DATABASE_PORT),
username: process.env.DATABASE_USER,
@ -11,10 +12,10 @@ const getDatabaseConfig = (): Parameters<typeof DatabaseModule['forRoot']> => { @@ -11,10 +12,10 @@ const getDatabaseConfig = (): Parameters<typeof DatabaseModule['forRoot']> => {
database: process.env.DATABASE_DB,
synchronize: true,
},
[],
];
};
ENTITIES,
]
}
export const $config = {
getDatabaseConfig,
};
}

3
src/core/exeptions/custom.exeptions.ts

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
export class CustomExeption {
isCustom: true
}

1
src/core/exeptions/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './users.exeptions'

3
src/core/exeptions/users.exeptions.ts

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
import { CustomExeption } from './custom.exeptions'
export class UserAlreadyExistException extends CustomExeption {}

1
src/core/index.ts

@ -1 +1,2 @@ @@ -1 +1,2 @@
export * from './exeptions'
export * from './namespaces'

66
src/core/namespaces/users.namespace.ts

@ -10,35 +10,23 @@ export namespace Users { @@ -10,35 +10,23 @@ export namespace Users {
/**
* Базовий інтерфейс користувача
*/
export interface User {
/**
* Унікальний ідентифікатор
*/
export interface UserModel {
/** Унікальний ідентифікатор */
id: number
/**
* Роль користувача, можливі значення Role.Admin, Role.User
*/
/** Роль користувача, можливі значення Role.Admin, Role.User */
role: Role
/**
* Почта користувача
*/
/** Почта користувача */
email: string
/**
* Робочий номер телефону по якому відбуваеться авторизація
*/
/** Робочий номер телефону по якому відбуваеться авторизація */
phoneNumber: string
/**
* Пароль в зашифрованому вигляді
*/
/** Пароль в зашифрованому вигляді */
password: string
/**
* Соль для шифрування паролю
*/
/** Сіль для шифрування паролю */
passwordSalt: string
}
@ -46,31 +34,57 @@ export namespace Users { @@ -46,31 +34,57 @@ export namespace Users {
* Інтерфейс інформації про користувача
*/
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
}
export interface IUsersService {
/**
* Метод для створення користувача
* @param {SaveUserPaylod} payload - Данні нового користувача
* @returns Повертає id створеного користувача
*/
save(payload: SaveUserPaylod): Promise<number>
}
}

1
src/domain/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './users/users.module'

20
src/domain/sessions/sessions.module.ts

@ -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,
}
}
}

70
src/domain/users/classes/user-creator.ts

@ -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)
}
}
}

4
src/domain/users/consts/index.ts

@ -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')

15
src/domain/users/entities/user.entity.ts

@ -2,27 +2,22 @@ import { Users } from 'src/core' @@ -2,27 +2,22 @@ import { Users } from 'src/core'
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
@Entity('users')
export class User implements Users.User {
export class User implements Users.UserModel {
@PrimaryGeneratedColumn()
id: number
@Column({ type: 'char', default: Users.Role.User, nullable: false })
role: Users.Role
@Column({ type: 'varchar', nullable: false, unique: true })
email: string
/**
* Робочий номер телефону по якому відбуваеться авторизація
*/
@Column({ type: 'varchar', nullable: false, unique: true })
phoneNumber: string
/**
* Пароль в зашифрованому вигляді
*/
@Column({ type: 'varchar', nullable: false, select: false })
password: string
/**
* Соль для шифрування паролю
*/
@Column({ type: 'varchar', nullable: false, select: false })
passwordSalt: string
}

2
src/domain/users/interfaces/index.ts

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
export * from './users-db.interfaces'
export * from './users-module-options.interface'

5
src/domain/users/interfaces/users-db.interfaces.ts

@ -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>

3
src/domain/users/interfaces/users-module-options.interface.ts

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
export interface UsersModuleOptions {
passwordHashSalt: string
}

6
src/domain/users/services/index.ts

@ -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 }

40
src/domain/users/services/users-passwords.service.ts

@ -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
}
}

45
src/domain/users/services/users.service.ts

@ -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
}
}

27
src/domain/users/users.module.ts

@ -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(),
}
}
}

26
src/libs/database/database.module.ts

@ -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 })],
}
}
}

12
src/libs/database/helpers/get-repository.helper.ts

@ -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],
}
}

14
src/main.ts

@ -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()

7
src/shared/helpers/get-env.helpers.ts

@ -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
}

2
src/shared/helpers/index.ts

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
export * from './get-env.helpers'
export * from './phone-number.helpers'

10
src/shared/helpers/phone-number.helpers.ts

@ -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')
}

1
src/shared/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './helpers'
Loading…
Cancel
Save