@merkaly/api 0.1.9-1 → 0.1.9-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -79
- package/package.json +89 -89
- package/src/account/auth/auth.decorator.d.ts +5 -4
- package/src/account/auth/auth.decorator.d.ts.map +1 -0
- package/src/account/auth/auth.decorator.ts +10 -10
- package/src/account/auth/auth.guard.d.ts +16 -15
- package/src/account/auth/auth.guard.d.ts.map +1 -0
- package/src/account/auth/auth.guard.ts +41 -41
- package/src/account/auth/auth.strategy.d.ts +18 -17
- package/src/account/auth/auth.strategy.d.ts.map +1 -0
- package/src/account/auth/auth.strategy.ts +31 -31
- package/src/account/auth/auth.validator.d.ts +5 -4
- package/src/account/auth/auth.validator.d.ts.map +1 -0
- package/src/account/auth/auth.validator.ts +11 -11
- package/src/account/auth/index.d.ts +2 -1
- package/src/account/auth/index.d.ts.map +1 -0
- package/src/account/auth/index.ts +1 -1
- package/src/account/index.d.ts +5 -4
- package/src/account/index.d.ts.map +1 -0
- package/src/account/index.ts +4 -4
- package/src/account/organizations/index.d.ts +4 -3
- package/src/account/organizations/index.d.ts.map +1 -0
- package/src/account/organizations/index.ts +3 -3
- package/src/account/organizations/members/index.d.ts +2 -1
- package/src/account/organizations/members/index.d.ts.map +1 -0
- package/src/account/organizations/members/index.ts +1 -1
- package/src/account/organizations/members/member.entity.d.ts +10 -9
- package/src/account/organizations/members/member.entity.d.ts.map +1 -0
- package/src/account/organizations/members/member.entity.ts +11 -11
- package/src/account/organizations/members/member.validator.d.ts +3 -2
- package/src/account/organizations/members/member.validator.d.ts.map +1 -0
- package/src/account/organizations/members/member.validator.ts +3 -3
- package/src/account/organizations/organization.entity.d.ts +18 -17
- package/src/account/organizations/organization.entity.d.ts.map +1 -0
- package/src/account/organizations/organization.entity.ts +24 -24
- package/src/account/organizations/organization.validator.d.ts +14 -13
- package/src/account/organizations/organization.validator.d.ts.map +1 -0
- package/src/account/organizations/organization.validator.ts +41 -52
- package/src/account/roles/index.d.ts +4 -3
- package/src/account/roles/index.d.ts.map +1 -0
- package/src/account/roles/index.ts +3 -3
- package/src/account/roles/role.entity.d.ts +8 -7
- package/src/account/roles/role.entity.d.ts.map +1 -0
- package/src/account/roles/role.entity.ts +9 -9
- package/src/account/roles/role.validator.d.ts +10 -9
- package/src/account/roles/role.validator.d.ts.map +1 -0
- package/src/account/roles/role.validator.ts +21 -21
- package/src/account/roles/users/index.d.ts +3 -2
- package/src/account/roles/users/index.d.ts.map +1 -0
- package/src/account/roles/users/index.ts +2 -2
- package/src/account/roles/users/user.entity.d.ts +10 -9
- package/src/account/roles/users/user.entity.d.ts.map +1 -0
- package/src/account/roles/users/user.entity.ts +11 -11
- package/src/account/roles/users/user.validator.d.ts +3 -2
- package/src/account/roles/users/user.validator.d.ts.map +1 -0
- package/src/account/roles/users/user.validator.ts +3 -3
- package/src/account/users/index.d.ts +4 -3
- package/src/account/users/index.d.ts.map +1 -0
- package/src/account/users/index.ts +3 -3
- package/src/account/users/roles/index.d.ts +3 -2
- package/src/account/users/roles/index.d.ts.map +1 -0
- package/src/account/users/roles/index.ts +2 -2
- package/src/account/users/roles/role.entity.d.ts +10 -9
- package/src/account/users/roles/role.entity.d.ts.map +1 -0
- package/src/account/users/roles/role.entity.ts +11 -11
- package/src/account/users/roles/role.validator.d.ts +3 -2
- package/src/account/users/roles/role.validator.d.ts.map +1 -0
- package/src/account/users/roles/role.validator.ts +3 -3
- package/src/account/users/user.entity.d.ts +33 -32
- package/src/account/users/user.entity.d.ts.map +1 -0
- package/src/account/users/user.entity.ts +36 -36
- package/src/account/users/user.validator.d.ts +12 -11
- package/src/account/users/user.validator.d.ts.map +1 -0
- package/src/account/users/user.validator.ts +29 -29
- package/src/app.d.ts +2 -1
- package/src/app.d.ts.map +1 -0
- package/src/app.emitter.d.ts +17 -16
- package/src/app.emitter.d.ts.map +1 -0
- package/src/app.emitter.ts +27 -27
- package/src/app.entity.d.ts +8 -7
- package/src/app.entity.d.ts.map +1 -0
- package/src/app.entity.ts +13 -13
- package/src/app.routes.d.ts +4 -3
- package/src/app.routes.d.ts.map +1 -0
- package/src/app.routes.ts +61 -61
- package/src/index.d.ts +4 -3
- package/src/index.d.ts.map +1 -0
- package/src/index.ts +3 -3
- package/src/inventory/brands/brand.entity.d.ts +6 -5
- package/src/inventory/brands/brand.entity.d.ts.map +1 -0
- package/src/inventory/brands/brand.entity.ts +10 -10
- package/src/inventory/brands/brand.validator.d.ts +7 -6
- package/src/inventory/brands/brand.validator.d.ts.map +1 -0
- package/src/inventory/brands/brand.validator.ts +12 -12
- package/src/inventory/brands/index.d.ts +3 -2
- package/src/inventory/brands/index.d.ts.map +1 -0
- package/src/inventory/brands/index.ts +2 -2
- package/src/inventory/categories/category.entity.d.ts +6 -5
- package/src/inventory/categories/category.entity.d.ts.map +1 -0
- package/src/inventory/categories/category.entity.ts +10 -10
- package/src/inventory/categories/category.validator.d.ts +7 -6
- package/src/inventory/categories/category.validator.d.ts.map +1 -0
- package/src/inventory/categories/category.validator.ts +11 -11
- package/src/inventory/categories/index.d.ts +3 -2
- package/src/inventory/categories/index.d.ts.map +1 -0
- package/src/inventory/categories/index.ts +2 -2
- package/src/inventory/index.d.ts +6 -5
- package/src/inventory/index.d.ts.map +1 -0
- package/src/inventory/index.ts +6 -6
- package/src/inventory/products/index.d.ts +5 -4
- package/src/inventory/products/index.d.ts.map +1 -0
- package/src/inventory/products/index.ts +4 -4
- package/src/inventory/products/media/index.d.ts +3 -2
- package/src/inventory/products/media/index.d.ts.map +1 -0
- package/src/inventory/products/media/index.ts +2 -2
- package/src/inventory/products/media/media.entity.d.ts +7 -6
- package/src/inventory/products/media/media.entity.d.ts.map +1 -0
- package/src/inventory/products/media/media.entity.ts +10 -10
- package/src/inventory/products/media/media.validator.d.ts +5 -4
- package/src/inventory/products/media/media.validator.d.ts.map +1 -0
- package/src/inventory/products/media/media.validator.ts +7 -7
- package/src/inventory/products/product.entity.d.ts +32 -31
- package/src/inventory/products/product.entity.d.ts.map +1 -0
- package/src/inventory/products/product.entity.ts +63 -63
- package/src/inventory/products/product.validator.d.ts +22 -21
- package/src/inventory/products/product.validator.d.ts.map +1 -0
- package/src/inventory/products/product.validator.ts +70 -70
- package/src/inventory/products/variants/index.d.ts +3 -2
- package/src/inventory/products/variants/index.d.ts.map +1 -0
- package/src/inventory/products/variants/index.ts +2 -2
- package/src/inventory/products/variants/variant.entity.d.ts +7 -6
- package/src/inventory/products/variants/variant.entity.d.ts.map +1 -0
- package/src/inventory/products/variants/variant.entity.ts +11 -11
- package/src/inventory/products/variants/variant.validator.d.ts +5 -4
- package/src/inventory/products/variants/variant.validator.d.ts.map +1 -0
- package/src/inventory/products/variants/variant.validator.ts +7 -7
- package/src/inventory/properties/index.d.ts +3 -2
- package/src/inventory/properties/index.d.ts.map +1 -0
- package/src/inventory/properties/index.ts +2 -2
- package/src/inventory/properties/property.entity.d.ts +9 -8
- package/src/inventory/properties/property.entity.d.ts.map +1 -0
- package/src/inventory/properties/property.entity.ts +19 -19
- package/src/inventory/properties/property.validator.d.ts +9 -8
- package/src/inventory/properties/property.validator.d.ts.map +1 -0
- package/src/inventory/properties/property.validator.ts +20 -20
- package/src/store/carts/cart.entity.d.ts +15 -14
- package/src/store/carts/cart.entity.d.ts.map +1 -0
- package/src/store/carts/cart.entity.ts +21 -21
- package/src/store/carts/cart.validator.d.ts +5 -4
- package/src/store/carts/cart.validator.d.ts.map +1 -0
- package/src/store/carts/cart.validator.ts +7 -7
- package/src/store/carts/index.d.ts +3 -2
- package/src/store/carts/index.d.ts.map +1 -0
- package/src/store/carts/index.ts +2 -2
- package/src/store/index.d.ts +4 -3
- package/src/store/index.d.ts.map +1 -0
- package/src/store/index.ts +4 -4
- package/src/store/orders/index.d.ts +4 -3
- package/src/store/orders/index.d.ts.map +1 -0
- package/src/store/orders/index.ts +3 -3
- package/src/store/orders/items/index.d.ts +3 -2
- package/src/store/orders/items/index.d.ts.map +1 -0
- package/src/store/orders/items/index.ts +2 -2
- package/src/store/orders/items/item.entity.d.ts +8 -7
- package/src/store/orders/items/item.entity.d.ts.map +1 -0
- package/src/store/orders/items/item.entity.ts +14 -14
- package/src/store/orders/items/item.validator.d.ts +5 -4
- package/src/store/orders/items/item.validator.d.ts.map +1 -0
- package/src/store/orders/items/item.validator.ts +7 -7
- package/src/store/orders/order.entity.d.ts +10 -9
- package/src/store/orders/order.entity.d.ts.map +1 -0
- package/src/store/orders/order.entity.ts +18 -18
- package/src/store/orders/order.validator.d.ts +5 -4
- package/src/store/orders/order.validator.d.ts.map +1 -0
- package/src/store/orders/order.validator.ts +7 -7
- package/src/account/account.module.d.ts +0 -4
- package/src/account/account.module.ts +0 -15
- package/src/account/auth/auth.controller.d.ts +0 -10
- package/src/account/auth/auth.controller.ts +0 -38
- package/src/account/auth/auth.module.d.ts +0 -4
- package/src/account/auth/auth.module.ts +0 -26
- package/src/account/auth/auth.repository.d.ts +0 -6
- package/src/account/auth/auth.repository.ts +0 -39
- package/src/account/organizations/members/member.controller.d.ts +0 -9
- package/src/account/organizations/members/member.controller.ts +0 -33
- package/src/account/organizations/members/member.module.d.ts +0 -4
- package/src/account/organizations/members/member.module.ts +0 -14
- package/src/account/organizations/members/member.repository.d.ts +0 -12
- package/src/account/organizations/members/member.repository.ts +0 -43
- package/src/account/organizations/organization.controller.d.ts +0 -11
- package/src/account/organizations/organization.controller.ts +0 -42
- package/src/account/organizations/organization.module.d.ts +0 -4
- package/src/account/organizations/organization.module.ts +0 -16
- package/src/account/organizations/organization.repository.d.ts +0 -12
- package/src/account/organizations/organization.repository.ts +0 -74
- package/src/account/roles/role.controller.d.ts +0 -11
- package/src/account/roles/role.controller.ts +0 -39
- package/src/account/roles/role.module.d.ts +0 -4
- package/src/account/roles/role.module.ts +0 -15
- package/src/account/roles/role.repository.d.ts +0 -12
- package/src/account/roles/role.repository.ts +0 -63
- package/src/account/roles/users/user.controller.d.ts +0 -8
- package/src/account/roles/users/user.controller.ts +0 -28
- package/src/account/roles/users/user.module.d.ts +0 -4
- package/src/account/roles/users/user.module.ts +0 -14
- package/src/account/roles/users/user.repository.d.ts +0 -11
- package/src/account/roles/users/user.repository.ts +0 -34
- package/src/account/users/roles/role.controller.d.ts +0 -9
- package/src/account/users/roles/role.controller.ts +0 -34
- package/src/account/users/roles/role.module.d.ts +0 -4
- package/src/account/users/roles/role.module.ts +0 -14
- package/src/account/users/roles/role.repository.d.ts +0 -12
- package/src/account/users/roles/role.repository.ts +0 -38
- package/src/account/users/user.controller.d.ts +0 -11
- package/src/account/users/user.controller.ts +0 -39
- package/src/account/users/user.module.d.ts +0 -4
- package/src/account/users/user.module.ts +0 -15
- package/src/account/users/user.repository.d.ts +0 -12
- package/src/account/users/user.repository.ts +0 -53
- package/src/app.module.d.ts +0 -9
- package/src/app.module.ts +0 -45
- package/src/app.repository.d.ts +0 -5
- package/src/app.repository.ts +0 -12
- package/src/inventory/brands/brand.controller.d.ts +0 -11
- package/src/inventory/brands/brand.controller.ts +0 -41
- package/src/inventory/brands/brand.module.d.ts +0 -4
- package/src/inventory/brands/brand.module.ts +0 -14
- package/src/inventory/brands/brand.repository.d.ts +0 -13
- package/src/inventory/brands/brand.repository.ts +0 -36
- package/src/inventory/categories/category.controller.d.ts +0 -11
- package/src/inventory/categories/category.controller.ts +0 -43
- package/src/inventory/categories/category.module.d.ts +0 -4
- package/src/inventory/categories/category.module.ts +0 -14
- package/src/inventory/categories/category.repository.d.ts +0 -13
- package/src/inventory/categories/category.repository.ts +0 -36
- package/src/inventory/inventory.module.d.ts +0 -4
- package/src/inventory/inventory.module.ts +0 -17
- package/src/inventory/products/media/media.controller.d.ts +0 -7
- package/src/inventory/products/media/media.controller.ts +0 -23
- package/src/inventory/products/media/media.module.d.ts +0 -4
- package/src/inventory/products/media/media.module.ts +0 -14
- package/src/inventory/products/media/media.repository.d.ts +0 -10
- package/src/inventory/products/media/media.repository.ts +0 -22
- package/src/inventory/products/product.controller.d.ts +0 -12
- package/src/inventory/products/product.controller.ts +0 -59
- package/src/inventory/products/product.module.d.ts +0 -4
- package/src/inventory/products/product.module.ts +0 -16
- package/src/inventory/products/product.repository.d.ts +0 -18
- package/src/inventory/products/product.repository.ts +0 -94
- package/src/inventory/products/variants/variant.controller.d.ts +0 -7
- package/src/inventory/products/variants/variant.controller.ts +0 -23
- package/src/inventory/products/variants/variant.module.d.ts +0 -4
- package/src/inventory/products/variants/variant.module.ts +0 -14
- package/src/inventory/products/variants/variant.repository.d.ts +0 -10
- package/src/inventory/products/variants/variant.repository.ts +0 -23
- package/src/inventory/properties/property.controller.d.ts +0 -11
- package/src/inventory/properties/property.controller.ts +0 -42
- package/src/inventory/properties/property.module.d.ts +0 -4
- package/src/inventory/properties/property.module.ts +0 -14
- package/src/inventory/properties/property.repository.d.ts +0 -13
- package/src/inventory/properties/property.repository.ts +0 -38
- package/src/store/carts/cart.controller.d.ts +0 -11
- package/src/store/carts/cart.controller.ts +0 -44
- package/src/store/carts/cart.module.d.ts +0 -4
- package/src/store/carts/cart.module.ts +0 -14
- package/src/store/carts/cart.repository.d.ts +0 -13
- package/src/store/carts/cart.repository.ts +0 -36
- package/src/store/orders/items/item.controller.d.ts +0 -11
- package/src/store/orders/items/item.controller.ts +0 -41
- package/src/store/orders/items/item.module.d.ts +0 -4
- package/src/store/orders/items/item.module.ts +0 -14
- package/src/store/orders/items/item.repository.d.ts +0 -13
- package/src/store/orders/items/item.repository.ts +0 -35
- package/src/store/orders/order.controller.d.ts +0 -11
- package/src/store/orders/order.controller.ts +0 -44
- package/src/store/orders/order.module.d.ts +0 -4
- package/src/store/orders/order.module.ts +0 -15
- package/src/store/orders/order.repository.d.ts +0 -13
- package/src/store/orders/order.repository.ts +0 -35
- package/src/store/store.module.d.ts +0 -4
- package/src/store/store.module.ts +0 -14
package/README.md
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
|
|
6
|
-
|
|
7
|
-
[travis-url]: https://travis-ci.org/nestjs/nest
|
|
8
|
-
|
|
9
|
-
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
|
|
10
|
-
|
|
11
|
-
[linux-url]: https://travis-ci.org/nestjs/nest
|
|
12
|
-
|
|
13
|
-
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
|
|
14
|
-
<p align="center">
|
|
15
|
-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
|
16
|
-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
|
17
|
-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
|
|
18
|
-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
|
|
19
|
-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
|
|
20
|
-
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a>
|
|
21
|
-
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
|
|
22
|
-
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
23
|
-
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
|
24
|
-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
|
|
25
|
-
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
|
26
|
-
</p>
|
|
27
|
-
<!--[](https://opencollective.com/nest#backer)
|
|
28
|
-
[](https://opencollective.com/nest#sponsor)-->
|
|
29
|
-
|
|
30
|
-
## Description
|
|
31
|
-
|
|
32
|
-
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
|
33
|
-
|
|
34
|
-
## Installation
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
$ npm install
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Running the app
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
# development
|
|
44
|
-
$ npm run start
|
|
45
|
-
|
|
46
|
-
# watch mode
|
|
47
|
-
$ npm run start:dev
|
|
48
|
-
|
|
49
|
-
# production mode
|
|
50
|
-
$ npm run start:prod
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Test
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# unit tests
|
|
57
|
-
$ npm run test
|
|
58
|
-
|
|
59
|
-
# e2e tests
|
|
60
|
-
$ npm run test:e2e
|
|
61
|
-
|
|
62
|
-
# test coverage
|
|
63
|
-
$ npm run test:cov
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Support
|
|
67
|
-
|
|
68
|
-
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If
|
|
69
|
-
you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
|
70
|
-
|
|
71
|
-
## Stay in touch
|
|
72
|
-
|
|
73
|
-
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
|
|
74
|
-
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
75
|
-
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
|
76
|
-
|
|
77
|
-
## License
|
|
78
|
-
|
|
79
|
-
Nest is [MIT licensed](LICENSE).
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
|
|
6
|
+
|
|
7
|
+
[travis-url]: https://travis-ci.org/nestjs/nest
|
|
8
|
+
|
|
9
|
+
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
|
|
10
|
+
|
|
11
|
+
[linux-url]: https://travis-ci.org/nestjs/nest
|
|
12
|
+
|
|
13
|
+
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
|
16
|
+
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
|
17
|
+
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
|
|
18
|
+
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
|
|
19
|
+
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
|
|
20
|
+
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a>
|
|
21
|
+
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
|
|
22
|
+
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
23
|
+
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
|
24
|
+
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
|
|
25
|
+
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
|
26
|
+
</p>
|
|
27
|
+
<!--[](https://opencollective.com/nest#backer)
|
|
28
|
+
[](https://opencollective.com/nest#sponsor)-->
|
|
29
|
+
|
|
30
|
+
## Description
|
|
31
|
+
|
|
32
|
+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
$ npm install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Running the app
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# development
|
|
44
|
+
$ npm run start
|
|
45
|
+
|
|
46
|
+
# watch mode
|
|
47
|
+
$ npm run start:dev
|
|
48
|
+
|
|
49
|
+
# production mode
|
|
50
|
+
$ npm run start:prod
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Test
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# unit tests
|
|
57
|
+
$ npm run test
|
|
58
|
+
|
|
59
|
+
# e2e tests
|
|
60
|
+
$ npm run test:e2e
|
|
61
|
+
|
|
62
|
+
# test coverage
|
|
63
|
+
$ npm run test:cov
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Support
|
|
67
|
+
|
|
68
|
+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If
|
|
69
|
+
you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
|
70
|
+
|
|
71
|
+
## Stay in touch
|
|
72
|
+
|
|
73
|
+
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
|
|
74
|
+
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
75
|
+
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
Nest is [MIT licensed](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@merkaly/api",
|
|
3
|
-
"version": "0.1.9-
|
|
4
|
-
"description": "NestJS Backend ApiRest Service",
|
|
5
|
-
"author": "Randy Tellez Galan <kronhyx@gmail.com>",
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
|
-
"main": "src",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prebuild": "yarn run clean",
|
|
10
|
-
"prepack": "yarn build",
|
|
11
|
-
"build": "nest build",
|
|
12
|
-
"clean": "tsc -b --clean",
|
|
13
|
-
"start": "nest start --preserveWatchOutput",
|
|
14
|
-
"dev": "yarn
|
|
15
|
-
"start:debug": "yarn dev -- --debug ",
|
|
16
|
-
"start:prod": "node dist/index.js",
|
|
17
|
-
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" . ",
|
|
18
|
-
"test": "jest",
|
|
19
|
-
"test:watch": "yarn test -- --watch",
|
|
20
|
-
"test:cov": "yarn test -- --coverage",
|
|
21
|
-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
22
|
-
"semantic-release": "yarn run build:package && semantic-release"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@nestjs/axios": "^0.0.5",
|
|
26
|
-
"@nestjs/swagger": "^5.0.9",
|
|
27
|
-
"@types/auth0": "^2.33.4",
|
|
28
|
-
"@types/node": "^17.0.2",
|
|
29
|
-
"auth0": "^2.35.0",
|
|
30
|
-
"class-transformer": "^0.5.1",
|
|
31
|
-
"class-validator": "^0.13.1",
|
|
32
|
-
"fireorm": "^0.23.0",
|
|
33
|
-
"reflect-metadata": "^0.1.13"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@commitlint/config-conventional": "^16.0.0",
|
|
37
|
-
"@elastic/elasticsearch": "^7.13.0",
|
|
38
|
-
"@nestjs/cli": "8.2.0",
|
|
39
|
-
"@nestjs/common": "8.2.6",
|
|
40
|
-
"@nestjs/config": "^1.0.0",
|
|
41
|
-
"@nestjs/core": "8.2.6",
|
|
42
|
-
"@nestjs/elasticsearch": "8.0.0",
|
|
43
|
-
"@nestjs/event-emitter": "^1.0.0",
|
|
44
|
-
"@nestjs/jwt": "8.0.0",
|
|
45
|
-
"@nestjs/passport": "8.1.0",
|
|
46
|
-
"@nestjs/platform-express": "8.2.6",
|
|
47
|
-
"@nestjs/schematics": "8.0.5",
|
|
48
|
-
"@nestjs/testing": "8.2.6",
|
|
49
|
-
"@semantic-release/exec": "^6.0.1",
|
|
50
|
-
"@semantic-release/git": "^10.0.0",
|
|
51
|
-
"@types/express": "^4.17.12",
|
|
52
|
-
"@types/faker": "^5.5.9",
|
|
53
|
-
"@types/jest": "^27.0.0",
|
|
54
|
-
"@types/multer": "^1.4.7",
|
|
55
|
-
"@types/passport-jwt": "^3.0.5",
|
|
56
|
-
"@types/supertest": "^2.0.11",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "4.33.0",
|
|
58
|
-
"@typescript-eslint/parser": "4.33.0",
|
|
59
|
-
"commitlint": "^16.1.0",
|
|
60
|
-
"eslint": "7.32.0",
|
|
61
|
-
"eslint-plugin-import": "^2.23.4",
|
|
62
|
-
"faker": "^5.5.3",
|
|
63
|
-
"firebase": "^9.0.0",
|
|
64
|
-
"firebase-admin": "^10.0.2",
|
|
65
|
-
"husky": "^7.0.0",
|
|
66
|
-
"jest": "27.4.7",
|
|
67
|
-
"passport": "^0.4.1",
|
|
68
|
-
"passport-jwt": "^4.0.0",
|
|
69
|
-
"rimraf": "^3.0.2",
|
|
70
|
-
"rxjs": "^7.2.0",
|
|
71
|
-
"semantic-release": "^18.0.0",
|
|
72
|
-
"supertest": "^6.1.3",
|
|
73
|
-
"swagger-ui-express": "^4.1.5",
|
|
74
|
-
"ts-jest": "27.1.3",
|
|
75
|
-
"ts-loader": "^9.2.3",
|
|
76
|
-
"ts-node": "^10.0.0",
|
|
77
|
-
"tsconfig-paths": "^3.9.0"
|
|
78
|
-
},
|
|
79
|
-
"repository": {
|
|
80
|
-
"type": "git",
|
|
81
|
-
"url": "https://github.com/sk-merkaly/api.git"
|
|
82
|
-
},
|
|
83
|
-
"publishConfig": {
|
|
84
|
-
"access": "public"
|
|
85
|
-
},
|
|
86
|
-
"engines": {
|
|
87
|
-
"node": "
|
|
88
|
-
}
|
|
89
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@merkaly/api",
|
|
3
|
+
"version": "0.1.9-10",
|
|
4
|
+
"description": "NestJS Backend ApiRest Service",
|
|
5
|
+
"author": "Randy Tellez Galan <kronhyx@gmail.com>",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"main": "src",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prebuild": "yarn run clean",
|
|
10
|
+
"prepack": "yarn build",
|
|
11
|
+
"build": "nest build",
|
|
12
|
+
"clean": "tsc -b --clean",
|
|
13
|
+
"start": "nest start --preserveWatchOutput",
|
|
14
|
+
"dev": "yarn build && yarn start --watch",
|
|
15
|
+
"start:debug": "yarn dev -- --debug ",
|
|
16
|
+
"start:prod": "node dist/index.js",
|
|
17
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" . ",
|
|
18
|
+
"test": "jest",
|
|
19
|
+
"test:watch": "yarn test -- --watch",
|
|
20
|
+
"test:cov": "yarn test -- --coverage",
|
|
21
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
22
|
+
"semantic-release": "yarn run build:package && semantic-release"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@nestjs/axios": "^0.0.5",
|
|
26
|
+
"@nestjs/swagger": "^5.0.9",
|
|
27
|
+
"@types/auth0": "^2.33.4",
|
|
28
|
+
"@types/node": "^17.0.2",
|
|
29
|
+
"auth0": "^2.35.0",
|
|
30
|
+
"class-transformer": "^0.5.1",
|
|
31
|
+
"class-validator": "^0.13.1",
|
|
32
|
+
"fireorm": "^0.23.0",
|
|
33
|
+
"reflect-metadata": "^0.1.13"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@commitlint/config-conventional": "^16.0.0",
|
|
37
|
+
"@elastic/elasticsearch": "^7.13.0",
|
|
38
|
+
"@nestjs/cli": "8.2.0",
|
|
39
|
+
"@nestjs/common": "8.2.6",
|
|
40
|
+
"@nestjs/config": "^1.0.0",
|
|
41
|
+
"@nestjs/core": "8.2.6",
|
|
42
|
+
"@nestjs/elasticsearch": "8.0.0",
|
|
43
|
+
"@nestjs/event-emitter": "^1.0.0",
|
|
44
|
+
"@nestjs/jwt": "8.0.0",
|
|
45
|
+
"@nestjs/passport": "8.1.0",
|
|
46
|
+
"@nestjs/platform-express": "8.2.6",
|
|
47
|
+
"@nestjs/schematics": "8.0.5",
|
|
48
|
+
"@nestjs/testing": "8.2.6",
|
|
49
|
+
"@semantic-release/exec": "^6.0.1",
|
|
50
|
+
"@semantic-release/git": "^10.0.0",
|
|
51
|
+
"@types/express": "^4.17.12",
|
|
52
|
+
"@types/faker": "^5.5.9",
|
|
53
|
+
"@types/jest": "^27.0.0",
|
|
54
|
+
"@types/multer": "^1.4.7",
|
|
55
|
+
"@types/passport-jwt": "^3.0.5",
|
|
56
|
+
"@types/supertest": "^2.0.11",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "4.33.0",
|
|
58
|
+
"@typescript-eslint/parser": "4.33.0",
|
|
59
|
+
"commitlint": "^16.1.0",
|
|
60
|
+
"eslint": "7.32.0",
|
|
61
|
+
"eslint-plugin-import": "^2.23.4",
|
|
62
|
+
"faker": "^5.5.3",
|
|
63
|
+
"firebase": "^9.0.0",
|
|
64
|
+
"firebase-admin": "^10.0.2",
|
|
65
|
+
"husky": "^7.0.0",
|
|
66
|
+
"jest": "27.4.7",
|
|
67
|
+
"passport": "^0.4.1",
|
|
68
|
+
"passport-jwt": "^4.0.0",
|
|
69
|
+
"rimraf": "^3.0.2",
|
|
70
|
+
"rxjs": "^7.2.0",
|
|
71
|
+
"semantic-release": "^18.0.0",
|
|
72
|
+
"supertest": "^6.1.3",
|
|
73
|
+
"swagger-ui-express": "^4.1.5",
|
|
74
|
+
"ts-jest": "27.1.3",
|
|
75
|
+
"ts-loader": "^9.2.3",
|
|
76
|
+
"ts-node": "^10.0.0",
|
|
77
|
+
"tsconfig-paths": "^3.9.0"
|
|
78
|
+
},
|
|
79
|
+
"repository": {
|
|
80
|
+
"type": "git",
|
|
81
|
+
"url": "https://github.com/sk-merkaly/api.git"
|
|
82
|
+
},
|
|
83
|
+
"publishConfig": {
|
|
84
|
+
"access": "public"
|
|
85
|
+
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": "16"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CustomDecorator } from '@nestjs/common';
|
|
2
|
-
export declare const IS_PUBLIC_KEY = "isPublic";
|
|
3
|
-
export declare const Public: () => CustomDecorator;
|
|
4
|
-
export declare const User: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
1
|
+
import { CustomDecorator } from '@nestjs/common';
|
|
2
|
+
export declare const IS_PUBLIC_KEY = "isPublic";
|
|
3
|
+
export declare const Public: () => CustomDecorator;
|
|
4
|
+
export declare const User: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
5
|
+
//# sourceMappingURL=auth.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.decorator.d.ts","sourceRoot":"","sources":["auth.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,eAAe,EAAiC,MAAM,gBAAgB,CAAA;AAErG,eAAO,MAAM,aAAa,aAAa,CAAA;AACvC,eAAO,MAAM,MAAM,EAAE,MAAM,eAAwD,CAAA;AAEnF,eAAO,MAAM,IAAI,mDAIf,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createParamDecorator, CustomDecorator, ExecutionContext, SetMetadata } from '@nestjs/common'
|
|
2
|
-
|
|
3
|
-
export const IS_PUBLIC_KEY = 'isPublic'
|
|
4
|
-
export const Public: () => CustomDecorator = () => SetMetadata(IS_PUBLIC_KEY, true)
|
|
5
|
-
|
|
6
|
-
export const User = createParamDecorator((data: unknown, ctx: ExecutionContext): string => {
|
|
7
|
-
const request = ctx.switchToHttp().getRequest()
|
|
8
|
-
|
|
9
|
-
return request.user
|
|
10
|
-
})
|
|
1
|
+
import { createParamDecorator, CustomDecorator, ExecutionContext, SetMetadata } from '@nestjs/common'
|
|
2
|
+
|
|
3
|
+
export const IS_PUBLIC_KEY = 'isPublic'
|
|
4
|
+
export const Public: () => CustomDecorator = () => SetMetadata(IS_PUBLIC_KEY, true)
|
|
5
|
+
|
|
6
|
+
export const User = createParamDecorator((data: unknown, ctx: ExecutionContext): string => {
|
|
7
|
+
const request = ctx.switchToHttp().getRequest()
|
|
8
|
+
|
|
9
|
+
return request.user
|
|
10
|
+
})
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { ExecutionContext } from '@nestjs/common';
|
|
2
|
-
import AuthRepository from './auth.repository';
|
|
3
|
-
declare module 'express' {
|
|
4
|
-
interface Request {
|
|
5
|
-
user?: string;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
declare const AuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
|
9
|
-
export default class AuthGuard extends AuthGuard_base {
|
|
10
|
-
protected readonly authRepository: AuthRepository;
|
|
11
|
-
private reflector;
|
|
12
|
-
canActivate(context: ExecutionContext): Promise<any>;
|
|
13
|
-
handleRequest(err: Record<string, unknown>, user: string): any;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
1
|
+
import { ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import AuthRepository from './auth.repository';
|
|
3
|
+
declare module 'express' {
|
|
4
|
+
interface Request {
|
|
5
|
+
user?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
declare const AuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
|
9
|
+
export default class AuthGuard extends AuthGuard_base {
|
|
10
|
+
protected readonly authRepository: AuthRepository;
|
|
11
|
+
private reflector;
|
|
12
|
+
canActivate(context: ExecutionContext): Promise<any>;
|
|
13
|
+
handleRequest(err: Record<string, unknown>, user: string): any;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=auth.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA6C,MAAM,gBAAgB,CAAA;AAI5F,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAE9C,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,OAAO;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;KACd;CACF;;AAGD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAe;IAE1C,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACjD,OAAO,CAAC,SAAS,CAAW;IAEhC,WAAW,CAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC;IAa3D,aAAa,CAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG;CAShE"}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { ExecutionContext, Inject, Injectable, UnauthorizedException } from '@nestjs/common'
|
|
2
|
-
import { Reflector } from '@nestjs/core'
|
|
3
|
-
import { AuthGuard as JwtGuard } from '@nestjs/passport'
|
|
4
|
-
import { IS_PUBLIC_KEY } from './auth.decorator'
|
|
5
|
-
import AuthRepository from './auth.repository'
|
|
6
|
-
|
|
7
|
-
declare module 'express' {
|
|
8
|
-
interface Request {
|
|
9
|
-
user?: string
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@Injectable()
|
|
14
|
-
export default class AuthGuard extends JwtGuard('jwt') {
|
|
15
|
-
|
|
16
|
-
@Inject() protected readonly authRepository: AuthRepository
|
|
17
|
-
@Inject() private reflector: Reflector
|
|
18
|
-
|
|
19
|
-
async canActivate (context: ExecutionContext): Promise<any> {
|
|
20
|
-
const isPublic = this.reflector.getAllAndOverride<boolean>(IS_PUBLIC_KEY, [
|
|
21
|
-
context.getHandler(),
|
|
22
|
-
context.getClass()
|
|
23
|
-
])
|
|
24
|
-
|
|
25
|
-
if (isPublic) {
|
|
26
|
-
return true
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return super.canActivate(context)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
handleRequest (err: Record<string, unknown>, user: string): any {
|
|
33
|
-
|
|
34
|
-
if (err || !user) {
|
|
35
|
-
throw err || new UnauthorizedException()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return user
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
}
|
|
1
|
+
import { ExecutionContext, Inject, Injectable, UnauthorizedException } from '@nestjs/common'
|
|
2
|
+
import { Reflector } from '@nestjs/core'
|
|
3
|
+
import { AuthGuard as JwtGuard } from '@nestjs/passport'
|
|
4
|
+
import { IS_PUBLIC_KEY } from './auth.decorator'
|
|
5
|
+
import AuthRepository from './auth.repository'
|
|
6
|
+
|
|
7
|
+
declare module 'express' {
|
|
8
|
+
interface Request {
|
|
9
|
+
user?: string
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Injectable()
|
|
14
|
+
export default class AuthGuard extends JwtGuard('jwt') {
|
|
15
|
+
|
|
16
|
+
@Inject() protected readonly authRepository: AuthRepository
|
|
17
|
+
@Inject() private reflector: Reflector
|
|
18
|
+
|
|
19
|
+
async canActivate (context: ExecutionContext): Promise<any> {
|
|
20
|
+
const isPublic = this.reflector.getAllAndOverride<boolean>(IS_PUBLIC_KEY, [
|
|
21
|
+
context.getHandler(),
|
|
22
|
+
context.getClass()
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
if (isPublic) {
|
|
26
|
+
return true
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return super.canActivate(context)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
handleRequest (err: Record<string, unknown>, user: string): any {
|
|
33
|
+
|
|
34
|
+
if (err || !user) {
|
|
35
|
+
throw err || new UnauthorizedException()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return user
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { Strategy, StrategyOptions } from 'passport-jwt';
|
|
2
|
-
export declare const strategy: StrategyOptions;
|
|
3
|
-
interface DecodedUser {
|
|
4
|
-
iss: string;
|
|
5
|
-
sub: string;
|
|
6
|
-
aud: string[];
|
|
7
|
-
iat: number;
|
|
8
|
-
exp: number;
|
|
9
|
-
azp: string;
|
|
10
|
-
scope: string;
|
|
11
|
-
}
|
|
12
|
-
declare const AuthStrategy_base: new (...args: any[]) => Strategy;
|
|
13
|
-
export default class AuthStrategy extends AuthStrategy_base {
|
|
14
|
-
constructor();
|
|
15
|
-
validate({ sub }: DecodedUser): string;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
import { Strategy, StrategyOptions } from 'passport-jwt';
|
|
2
|
+
export declare const strategy: StrategyOptions;
|
|
3
|
+
interface DecodedUser {
|
|
4
|
+
iss: string;
|
|
5
|
+
sub: string;
|
|
6
|
+
aud: string[];
|
|
7
|
+
iat: number;
|
|
8
|
+
exp: number;
|
|
9
|
+
azp: string;
|
|
10
|
+
scope: string;
|
|
11
|
+
}
|
|
12
|
+
declare const AuthStrategy_base: new (...args: any[]) => Strategy;
|
|
13
|
+
export default class AuthStrategy extends AuthStrategy_base {
|
|
14
|
+
constructor();
|
|
15
|
+
validate({ sub }: DecodedUser): string;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=auth.strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.strategy.d.ts","sourceRoot":"","sources":["auth.strategy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEpE,eAAO,MAAM,QAAQ,EAAE,eAItB,CAAA;AAED,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;;AAGD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,iBAA0B;;IAKlE,QAAQ,CAAE,EAAE,GAAG,EAAE,EAAE,WAAW,GAAG,MAAM;CAGxC"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common'
|
|
2
|
-
import { PassportStrategy } from '@nestjs/passport'
|
|
3
|
-
import { readFileSync } from 'fs'
|
|
4
|
-
import { ExtractJwt, Strategy, StrategyOptions } from 'passport-jwt'
|
|
5
|
-
|
|
6
|
-
export const strategy: StrategyOptions = {
|
|
7
|
-
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
8
|
-
ignoreExpiration: false,
|
|
9
|
-
secretOrKey: process.env.AUTH_CERTIFICATE || readFileSync('authCertificate.pem')
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface DecodedUser {
|
|
13
|
-
iss: string,
|
|
14
|
-
sub: string,
|
|
15
|
-
aud: string[],
|
|
16
|
-
iat: number,
|
|
17
|
-
exp: number,
|
|
18
|
-
azp: string,
|
|
19
|
-
scope: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@Injectable()
|
|
23
|
-
export default class AuthStrategy extends PassportStrategy(Strategy) {
|
|
24
|
-
constructor () {
|
|
25
|
-
super(strategy)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
validate ({ sub }: DecodedUser): string {
|
|
29
|
-
return sub
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common'
|
|
2
|
+
import { PassportStrategy } from '@nestjs/passport'
|
|
3
|
+
import { readFileSync } from 'fs'
|
|
4
|
+
import { ExtractJwt, Strategy, StrategyOptions } from 'passport-jwt'
|
|
5
|
+
|
|
6
|
+
export const strategy: StrategyOptions = {
|
|
7
|
+
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
8
|
+
ignoreExpiration: false,
|
|
9
|
+
secretOrKey: process.env.AUTH_CERTIFICATE || readFileSync('authCertificate.pem')
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface DecodedUser {
|
|
13
|
+
iss: string,
|
|
14
|
+
sub: string,
|
|
15
|
+
aud: string[],
|
|
16
|
+
iat: number,
|
|
17
|
+
exp: number,
|
|
18
|
+
azp: string,
|
|
19
|
+
scope: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Injectable()
|
|
23
|
+
export default class AuthStrategy extends PassportStrategy(Strategy) {
|
|
24
|
+
constructor () {
|
|
25
|
+
super(strategy)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
validate ({ sub }: DecodedUser): string {
|
|
29
|
+
return sub
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare class LoginValidator {
|
|
2
|
-
username: string;
|
|
3
|
-
password: string;
|
|
4
|
-
}
|
|
1
|
+
export declare class LoginValidator {
|
|
2
|
+
username: string;
|
|
3
|
+
password: string;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=auth.validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.validator.d.ts","sourceRoot":"","sources":["auth.validator.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IAGzB,QAAQ,EAAE,MAAM,CAAA;IAGhB,QAAQ,EAAE,MAAM,CAAA;CAEjB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IsEmail, IsNotEmpty } from 'class-validator'
|
|
2
|
-
|
|
3
|
-
export class LoginValidator {
|
|
4
|
-
|
|
5
|
-
@IsEmail()
|
|
6
|
-
username: string
|
|
7
|
-
|
|
8
|
-
@IsNotEmpty()
|
|
9
|
-
password: string
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import { IsEmail, IsNotEmpty } from 'class-validator'
|
|
2
|
+
|
|
3
|
+
export class LoginValidator {
|
|
4
|
+
|
|
5
|
+
@IsEmail()
|
|
6
|
+
username: string
|
|
7
|
+
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
password: string
|
|
10
|
+
|
|
11
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const $AuthPath = "auth";
|
|
1
|
+
export declare const $AuthPath = "auth";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAAS,CAAA"}
|