@illustrisinteractive/sentinel 0.0.3 → 0.0.4
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/package.json +25 -86
- package/.prettierrc +0 -4
- package/README.md +0 -98
- package/dist/main.js +0 -497
- package/eslint.config.mjs +0 -35
- package/libs/sentinel/tsconfig.lib.json +0 -9
- package/nest-cli.json +0 -10
- package/src/app.controller.spec.ts +0 -22
- package/src/app.controller.ts +0 -12
- package/src/app.module.ts +0 -17
- package/src/app.service.ts +0 -8
- package/src/main.ts +0 -8
- package/src/models/sentinel/TestResource.ts +0 -22
- package/src/models/sentinel/TransactionResource.ts +0 -22
- package/test/app.e2e-spec.ts +0 -25
- package/test/jest-e2e.json +0 -16
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -33
- /package/{libs/sentinel/src → src}/helpers/hasDuplicates.ts +0 -0
- /package/{libs/sentinel/src → src}/index.ts +0 -0
- /package/{libs/sentinel/src → src}/models/PermissionKey.ts +0 -0
- /package/{libs/sentinel/src → src}/models/Role.ts +0 -0
- /package/{libs/sentinel/src → src}/models/RoleHasPermissions.ts +0 -0
- /package/{libs/sentinel/src → src}/models/SecuredResource.ts +0 -0
- /package/{libs/sentinel/src → src}/models/SentinelModuleOptions.ts +0 -0
- /package/{libs/sentinel/src → src}/sentinel.module-definition.ts +0 -0
- /package/{libs/sentinel/src → src}/sentinel.module.ts +0 -0
- /package/{libs/sentinel/src → src}/sentinel.service.spec.ts +0 -0
- /package/{libs/sentinel/src → src}/sentinel.service.ts +0 -0
- /package/{libs/sentinel/src → src}/sentinel.service.ts.old +0 -0
package/package.json
CHANGED
|
@@ -1,86 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@illustrisinteractive/sentinel",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"@nestjs/core": "^11.0.1",
|
|
27
|
-
"@nestjs/platform-express": "^11.0.1",
|
|
28
|
-
"@nestjs/sequelize": "^11.0.1",
|
|
29
|
-
"mysql2": "^3.17.0",
|
|
30
|
-
"pg": "^8.18.0",
|
|
31
|
-
"reflect-metadata": "^0.2.2",
|
|
32
|
-
"rxjs": "^7.8.1",
|
|
33
|
-
"sequelize": "^6.37.7",
|
|
34
|
-
"sequelize-typescript": "^2.1.6"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@eslint/eslintrc": "^3.2.0",
|
|
38
|
-
"@eslint/js": "^9.18.0",
|
|
39
|
-
"@nestjs/cli": "^11.0.0",
|
|
40
|
-
"@nestjs/schematics": "^11.0.0",
|
|
41
|
-
"@nestjs/testing": "^11.0.1",
|
|
42
|
-
"@types/express": "^5.0.0",
|
|
43
|
-
"@types/jest": "^30.0.0",
|
|
44
|
-
"@types/node": "^22.10.7",
|
|
45
|
-
"@types/sequelize": "^4.28.20",
|
|
46
|
-
"@types/supertest": "^6.0.2",
|
|
47
|
-
"eslint": "^9.18.0",
|
|
48
|
-
"eslint-config-prettier": "^10.0.1",
|
|
49
|
-
"eslint-plugin-prettier": "^5.2.2",
|
|
50
|
-
"globals": "^16.0.0",
|
|
51
|
-
"jest": "^30.0.0",
|
|
52
|
-
"prettier": "^3.4.2",
|
|
53
|
-
"source-map-support": "^0.5.21",
|
|
54
|
-
"supertest": "^7.0.0",
|
|
55
|
-
"ts-jest": "^29.2.5",
|
|
56
|
-
"ts-loader": "^9.5.2",
|
|
57
|
-
"ts-node": "^10.9.2",
|
|
58
|
-
"tsconfig-paths": "^4.2.0",
|
|
59
|
-
"typescript": "^5.7.3",
|
|
60
|
-
"typescript-eslint": "^8.20.0"
|
|
61
|
-
},
|
|
62
|
-
"jest": {
|
|
63
|
-
"moduleFileExtensions": [
|
|
64
|
-
"js",
|
|
65
|
-
"json",
|
|
66
|
-
"ts"
|
|
67
|
-
],
|
|
68
|
-
"rootDir": ".",
|
|
69
|
-
"testRegex": ".*\\.spec\\.ts$",
|
|
70
|
-
"transform": {
|
|
71
|
-
"^.+\\.(t|j)s$": "ts-jest"
|
|
72
|
-
},
|
|
73
|
-
"collectCoverageFrom": [
|
|
74
|
-
"**/*.(t|j)s"
|
|
75
|
-
],
|
|
76
|
-
"coverageDirectory": "./coverage",
|
|
77
|
-
"testEnvironment": "node",
|
|
78
|
-
"roots": [
|
|
79
|
-
"<rootDir>/src/",
|
|
80
|
-
"<rootDir>/libs/"
|
|
81
|
-
],
|
|
82
|
-
"moduleNameMapper": {
|
|
83
|
-
"^@app/sentinel(|/.*)$": "<rootDir>/libs/sentinel/src/$1"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@illustrisinteractive/sentinel",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"private": false,
|
|
5
|
+
"files": [
|
|
6
|
+
"src",
|
|
7
|
+
"!**/*.json",
|
|
8
|
+
"!**/*.tsbuildinfo"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@casl/ability": "^6.8.0",
|
|
13
|
+
"@nestjs/common": "^11.0.1",
|
|
14
|
+
"@nestjs/config": "^4.0.3",
|
|
15
|
+
"@nestjs/core": "^11.0.1",
|
|
16
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
17
|
+
"@nestjs/sequelize": "^11.0.1",
|
|
18
|
+
"mysql2": "^3.17.0",
|
|
19
|
+
"pg": "^8.18.0",
|
|
20
|
+
"reflect-metadata": "^0.2.2",
|
|
21
|
+
"rxjs": "^7.8.1",
|
|
22
|
+
"sequelize": "^6.37.7",
|
|
23
|
+
"sequelize-typescript": "^2.1.6"
|
|
24
|
+
}
|
|
25
|
+
}
|
package/.prettierrc
DELETED
package/README.md
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
|
6
|
-
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
|
7
|
-
|
|
8
|
-
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
|
9
|
-
<p align="center">
|
|
10
|
-
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
|
11
|
-
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
|
12
|
-
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
|
13
|
-
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
|
|
14
|
-
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
|
15
|
-
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
16
|
-
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
|
17
|
-
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
|
|
18
|
-
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
|
|
19
|
-
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
|
|
20
|
-
</p>
|
|
21
|
-
<!--[](https://opencollective.com/nest#backer)
|
|
22
|
-
[](https://opencollective.com/nest#sponsor)-->
|
|
23
|
-
|
|
24
|
-
## Description
|
|
25
|
-
|
|
26
|
-
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
|
27
|
-
|
|
28
|
-
## Project setup
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
$ npm install
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Compile and run the project
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
# development
|
|
38
|
-
$ npm run start
|
|
39
|
-
|
|
40
|
-
# watch mode
|
|
41
|
-
$ npm run start:dev
|
|
42
|
-
|
|
43
|
-
# production mode
|
|
44
|
-
$ npm run start:prod
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Run tests
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
# unit tests
|
|
51
|
-
$ npm run test
|
|
52
|
-
|
|
53
|
-
# e2e tests
|
|
54
|
-
$ npm run test:e2e
|
|
55
|
-
|
|
56
|
-
# test coverage
|
|
57
|
-
$ npm run test:cov
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Deployment
|
|
61
|
-
|
|
62
|
-
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
|
|
63
|
-
|
|
64
|
-
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
$ npm install -g @nestjs/mau
|
|
68
|
-
$ mau deploy
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
|
|
72
|
-
|
|
73
|
-
## Resources
|
|
74
|
-
|
|
75
|
-
Check out a few resources that may come in handy when working with NestJS:
|
|
76
|
-
|
|
77
|
-
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
|
78
|
-
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
|
79
|
-
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
|
80
|
-
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
|
81
|
-
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
|
82
|
-
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
|
83
|
-
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
|
84
|
-
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
|
85
|
-
|
|
86
|
-
## Support
|
|
87
|
-
|
|
88
|
-
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
|
89
|
-
|
|
90
|
-
## Stay in touch
|
|
91
|
-
|
|
92
|
-
- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
|
|
93
|
-
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
94
|
-
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
|
95
|
-
|
|
96
|
-
## License
|
|
97
|
-
|
|
98
|
-
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
|
package/dist/main.js
DELETED
|
@@ -1,497 +0,0 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ "use strict";
|
|
3
|
-
/******/ var __webpack_modules__ = ([
|
|
4
|
-
/* 0 */,
|
|
5
|
-
/* 1 */
|
|
6
|
-
/***/ ((module) => {
|
|
7
|
-
|
|
8
|
-
module.exports = require("@nestjs/core");
|
|
9
|
-
|
|
10
|
-
/***/ }),
|
|
11
|
-
/* 2 */
|
|
12
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
22
|
-
exports.AppModule = void 0;
|
|
23
|
-
const common_1 = __webpack_require__(3);
|
|
24
|
-
const app_controller_1 = __webpack_require__(4);
|
|
25
|
-
const app_service_1 = __webpack_require__(5);
|
|
26
|
-
const sentinel_1 = __webpack_require__(6);
|
|
27
|
-
const TransactionResource_1 = __webpack_require__(17);
|
|
28
|
-
let AppModule = class AppModule {
|
|
29
|
-
};
|
|
30
|
-
exports.AppModule = AppModule;
|
|
31
|
-
exports.AppModule = AppModule = __decorate([
|
|
32
|
-
(0, common_1.Module)({
|
|
33
|
-
imports: [
|
|
34
|
-
sentinel_1.SentinelModule.register({
|
|
35
|
-
resources: [TransactionResource_1.TransactionResource],
|
|
36
|
-
}),
|
|
37
|
-
],
|
|
38
|
-
controllers: [app_controller_1.AppController],
|
|
39
|
-
providers: [app_service_1.AppService],
|
|
40
|
-
})
|
|
41
|
-
], AppModule);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/***/ }),
|
|
45
|
-
/* 3 */
|
|
46
|
-
/***/ ((module) => {
|
|
47
|
-
|
|
48
|
-
module.exports = require("@nestjs/common");
|
|
49
|
-
|
|
50
|
-
/***/ }),
|
|
51
|
-
/* 4 */
|
|
52
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
56
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
57
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
58
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
59
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
60
|
-
};
|
|
61
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
62
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
63
|
-
};
|
|
64
|
-
var _a;
|
|
65
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
66
|
-
exports.AppController = void 0;
|
|
67
|
-
const common_1 = __webpack_require__(3);
|
|
68
|
-
const app_service_1 = __webpack_require__(5);
|
|
69
|
-
let AppController = class AppController {
|
|
70
|
-
appService;
|
|
71
|
-
constructor(appService) {
|
|
72
|
-
this.appService = appService;
|
|
73
|
-
}
|
|
74
|
-
getHello() {
|
|
75
|
-
return this.appService.getHello();
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
exports.AppController = AppController;
|
|
79
|
-
__decorate([
|
|
80
|
-
(0, common_1.Get)(),
|
|
81
|
-
__metadata("design:type", Function),
|
|
82
|
-
__metadata("design:paramtypes", []),
|
|
83
|
-
__metadata("design:returntype", String)
|
|
84
|
-
], AppController.prototype, "getHello", null);
|
|
85
|
-
exports.AppController = AppController = __decorate([
|
|
86
|
-
(0, common_1.Controller)(),
|
|
87
|
-
__metadata("design:paramtypes", [typeof (_a = typeof app_service_1.AppService !== "undefined" && app_service_1.AppService) === "function" ? _a : Object])
|
|
88
|
-
], AppController);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
/***/ }),
|
|
92
|
-
/* 5 */
|
|
93
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
97
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
98
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
99
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
100
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
101
|
-
};
|
|
102
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
103
|
-
exports.AppService = void 0;
|
|
104
|
-
const common_1 = __webpack_require__(3);
|
|
105
|
-
let AppService = class AppService {
|
|
106
|
-
getHello() {
|
|
107
|
-
return 'Hello World!';
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
exports.AppService = AppService;
|
|
111
|
-
exports.AppService = AppService = __decorate([
|
|
112
|
-
(0, common_1.Injectable)()
|
|
113
|
-
], AppService);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
/* 6 */
|
|
118
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
122
|
-
if (k2 === undefined) k2 = k;
|
|
123
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
124
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
125
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
126
|
-
}
|
|
127
|
-
Object.defineProperty(o, k2, desc);
|
|
128
|
-
}) : (function(o, m, k, k2) {
|
|
129
|
-
if (k2 === undefined) k2 = k;
|
|
130
|
-
o[k2] = m[k];
|
|
131
|
-
}));
|
|
132
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
133
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
134
|
-
};
|
|
135
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
136
|
-
__exportStar(__webpack_require__(7), exports);
|
|
137
|
-
__exportStar(__webpack_require__(8), exports);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
/***/ }),
|
|
141
|
-
/* 7 */
|
|
142
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
146
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
147
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
148
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
149
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
150
|
-
};
|
|
151
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
152
|
-
exports.SentinelModule = void 0;
|
|
153
|
-
const common_1 = __webpack_require__(3);
|
|
154
|
-
const sentinel_service_1 = __webpack_require__(8);
|
|
155
|
-
const sentinel_module_definition_1 = __webpack_require__(9);
|
|
156
|
-
const sequelize_1 = __webpack_require__(10);
|
|
157
|
-
const config_1 = __webpack_require__(16);
|
|
158
|
-
const PermissionKey_1 = __webpack_require__(11);
|
|
159
|
-
const Role_1 = __webpack_require__(14);
|
|
160
|
-
const RoleHasPermissions_1 = __webpack_require__(13);
|
|
161
|
-
let SentinelModule = class SentinelModule extends sentinel_module_definition_1.ConfigurableModuleClass {
|
|
162
|
-
};
|
|
163
|
-
exports.SentinelModule = SentinelModule;
|
|
164
|
-
exports.SentinelModule = SentinelModule = __decorate([
|
|
165
|
-
(0, common_1.Module)({
|
|
166
|
-
imports: [
|
|
167
|
-
sequelize_1.SequelizeModule.forRootAsync({
|
|
168
|
-
imports: [config_1.ConfigModule],
|
|
169
|
-
inject: [config_1.ConfigService],
|
|
170
|
-
useFactory: (configService) => ({
|
|
171
|
-
dialect: 'postgres',
|
|
172
|
-
host: configService.getOrThrow('SENTINEL_DB_HOST'),
|
|
173
|
-
port: configService.get('SENTINEL_DB_PORT') || 5432,
|
|
174
|
-
username: configService.getOrThrow('SENTINEL_DB_USER'),
|
|
175
|
-
password: configService.getOrThrow('SENTINEL_DB_PASS'),
|
|
176
|
-
database: configService.getOrThrow('SENTINEL_DB'),
|
|
177
|
-
models: [PermissionKey_1.PermissionKey, Role_1.Role, RoleHasPermissions_1.RoleHasPermissions],
|
|
178
|
-
autoLoadModels: true,
|
|
179
|
-
}),
|
|
180
|
-
}),
|
|
181
|
-
sequelize_1.SequelizeModule.forFeature([PermissionKey_1.PermissionKey, Role_1.Role, RoleHasPermissions_1.RoleHasPermissions]),
|
|
182
|
-
],
|
|
183
|
-
providers: [sentinel_service_1.SentinelService],
|
|
184
|
-
exports: [sentinel_service_1.SentinelService],
|
|
185
|
-
})
|
|
186
|
-
], SentinelModule);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
/***/ }),
|
|
190
|
-
/* 8 */
|
|
191
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
195
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
196
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
197
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
198
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
199
|
-
};
|
|
200
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
201
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
202
|
-
};
|
|
203
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
204
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
205
|
-
};
|
|
206
|
-
var SentinelService_1;
|
|
207
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
208
|
-
exports.SentinelService = void 0;
|
|
209
|
-
const common_1 = __webpack_require__(3);
|
|
210
|
-
const sentinel_module_definition_1 = __webpack_require__(9);
|
|
211
|
-
const sequelize_1 = __webpack_require__(10);
|
|
212
|
-
const PermissionKey_1 = __webpack_require__(11);
|
|
213
|
-
const hasDuplicates_1 = __webpack_require__(15);
|
|
214
|
-
let SentinelService = SentinelService_1 = class SentinelService {
|
|
215
|
-
options;
|
|
216
|
-
permissionKeyRepository;
|
|
217
|
-
logger = new common_1.Logger(SentinelService_1.name);
|
|
218
|
-
constructor(options, permissionKeyRepository) {
|
|
219
|
-
this.options = options;
|
|
220
|
-
this.permissionKeyRepository = permissionKeyRepository;
|
|
221
|
-
}
|
|
222
|
-
async onModuleInit() {
|
|
223
|
-
let noMatchingPermissionKey = false;
|
|
224
|
-
let duplicateResourceName = (0, hasDuplicates_1.hasDuplicates)(this.options.resources, 'name');
|
|
225
|
-
if (duplicateResourceName) {
|
|
226
|
-
this.logger.error(`Duplicate name property value detected from list of Secured Resources. Please ensure that all Secured Resources have unique names.`);
|
|
227
|
-
throw new Error(`Duplicate name property value detected from list of Secured Resources. Please ensure that all Secured Resources have unique names.`);
|
|
228
|
-
}
|
|
229
|
-
const permissions = await this.permissionKeyRepository.findAll();
|
|
230
|
-
this.logger.log(`${permissions.length} Permission Keys were found.`);
|
|
231
|
-
this.options.resources.forEach((resource) => {
|
|
232
|
-
resource.actions.forEach((action) => {
|
|
233
|
-
const matchingKey = permissions.find((permission) => permission.action == action.key &&
|
|
234
|
-
permission.resource == resource.name);
|
|
235
|
-
if (!matchingKey) {
|
|
236
|
-
this.logger.warn(`Action "${action.key}" from Secured Resource "${resource.name}" does not have a matching Permission Key in the database. If this Secured Resource was newly registered, did you run the Permission Key Migration?`);
|
|
237
|
-
noMatchingPermissionKey = true;
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
exports.SentinelService = SentinelService;
|
|
244
|
-
exports.SentinelService = SentinelService = SentinelService_1 = __decorate([
|
|
245
|
-
(0, common_1.Injectable)(),
|
|
246
|
-
__param(0, (0, common_1.Inject)(sentinel_module_definition_1.MODULE_OPTIONS_TOKEN)),
|
|
247
|
-
__param(1, (0, sequelize_1.InjectModel)(PermissionKey_1.PermissionKey)),
|
|
248
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
249
|
-
], SentinelService);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
/***/ }),
|
|
253
|
-
/* 9 */
|
|
254
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
var _a;
|
|
258
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
259
|
-
exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
|
|
260
|
-
const common_1 = __webpack_require__(3);
|
|
261
|
-
_a = new common_1.ConfigurableModuleBuilder().build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/***/ }),
|
|
265
|
-
/* 10 */
|
|
266
|
-
/***/ ((module) => {
|
|
267
|
-
|
|
268
|
-
module.exports = require("@nestjs/sequelize");
|
|
269
|
-
|
|
270
|
-
/***/ }),
|
|
271
|
-
/* 11 */
|
|
272
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
276
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
277
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
278
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
279
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
280
|
-
};
|
|
281
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
282
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
283
|
-
};
|
|
284
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
285
|
-
exports.PermissionKey = void 0;
|
|
286
|
-
const sequelize_typescript_1 = __webpack_require__(12);
|
|
287
|
-
const RoleHasPermissions_1 = __webpack_require__(13);
|
|
288
|
-
let PermissionKey = class PermissionKey extends sequelize_typescript_1.Model {
|
|
289
|
-
resource;
|
|
290
|
-
action;
|
|
291
|
-
description;
|
|
292
|
-
};
|
|
293
|
-
exports.PermissionKey = PermissionKey;
|
|
294
|
-
__decorate([
|
|
295
|
-
sequelize_typescript_1.Column,
|
|
296
|
-
__metadata("design:type", String)
|
|
297
|
-
], PermissionKey.prototype, "resource", void 0);
|
|
298
|
-
__decorate([
|
|
299
|
-
sequelize_typescript_1.Column,
|
|
300
|
-
__metadata("design:type", String)
|
|
301
|
-
], PermissionKey.prototype, "action", void 0);
|
|
302
|
-
__decorate([
|
|
303
|
-
sequelize_typescript_1.Column,
|
|
304
|
-
__metadata("design:type", String)
|
|
305
|
-
], PermissionKey.prototype, "description", void 0);
|
|
306
|
-
__decorate([
|
|
307
|
-
(0, sequelize_typescript_1.HasMany)(() => RoleHasPermissions_1.RoleHasPermissions),
|
|
308
|
-
__metadata("design:type", Object)
|
|
309
|
-
], PermissionKey.prototype, "roles", void 0);
|
|
310
|
-
exports.PermissionKey = PermissionKey = __decorate([
|
|
311
|
-
sequelize_typescript_1.Table
|
|
312
|
-
], PermissionKey);
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
/***/ }),
|
|
316
|
-
/* 12 */
|
|
317
|
-
/***/ ((module) => {
|
|
318
|
-
|
|
319
|
-
module.exports = require("sequelize-typescript");
|
|
320
|
-
|
|
321
|
-
/***/ }),
|
|
322
|
-
/* 13 */
|
|
323
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
327
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
328
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
329
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
330
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
331
|
-
};
|
|
332
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
333
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
334
|
-
};
|
|
335
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
336
|
-
exports.RoleHasPermissions = void 0;
|
|
337
|
-
const sequelize_typescript_1 = __webpack_require__(12);
|
|
338
|
-
const PermissionKey_1 = __webpack_require__(11);
|
|
339
|
-
const Role_1 = __webpack_require__(14);
|
|
340
|
-
let RoleHasPermissions = class RoleHasPermissions extends sequelize_typescript_1.Model {
|
|
341
|
-
};
|
|
342
|
-
exports.RoleHasPermissions = RoleHasPermissions;
|
|
343
|
-
__decorate([
|
|
344
|
-
(0, sequelize_typescript_1.ForeignKey)(() => PermissionKey_1.PermissionKey),
|
|
345
|
-
__metadata("design:type", Number)
|
|
346
|
-
], RoleHasPermissions.prototype, "permissionKeyId", void 0);
|
|
347
|
-
__decorate([
|
|
348
|
-
(0, sequelize_typescript_1.BelongsTo)(() => PermissionKey_1.PermissionKey),
|
|
349
|
-
__metadata("design:type", Object)
|
|
350
|
-
], RoleHasPermissions.prototype, "permissionKey", void 0);
|
|
351
|
-
__decorate([
|
|
352
|
-
(0, sequelize_typescript_1.ForeignKey)(() => Role_1.Role),
|
|
353
|
-
__metadata("design:type", Number)
|
|
354
|
-
], RoleHasPermissions.prototype, "roleId", void 0);
|
|
355
|
-
__decorate([
|
|
356
|
-
(0, sequelize_typescript_1.BelongsTo)(() => PermissionKey_1.PermissionKey),
|
|
357
|
-
__metadata("design:type", Object)
|
|
358
|
-
], RoleHasPermissions.prototype, "role", void 0);
|
|
359
|
-
exports.RoleHasPermissions = RoleHasPermissions = __decorate([
|
|
360
|
-
sequelize_typescript_1.Table
|
|
361
|
-
], RoleHasPermissions);
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
/***/ }),
|
|
365
|
-
/* 14 */
|
|
366
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
370
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
371
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
372
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
373
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
374
|
-
};
|
|
375
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
376
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
377
|
-
};
|
|
378
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
379
|
-
exports.Role = void 0;
|
|
380
|
-
const sequelize_typescript_1 = __webpack_require__(12);
|
|
381
|
-
const RoleHasPermissions_1 = __webpack_require__(13);
|
|
382
|
-
let Role = class Role extends sequelize_typescript_1.Model {
|
|
383
|
-
name;
|
|
384
|
-
};
|
|
385
|
-
exports.Role = Role;
|
|
386
|
-
__decorate([
|
|
387
|
-
sequelize_typescript_1.Column,
|
|
388
|
-
__metadata("design:type", String)
|
|
389
|
-
], Role.prototype, "name", void 0);
|
|
390
|
-
__decorate([
|
|
391
|
-
(0, sequelize_typescript_1.HasMany)(() => RoleHasPermissions_1.RoleHasPermissions),
|
|
392
|
-
__metadata("design:type", Object)
|
|
393
|
-
], Role.prototype, "permissions", void 0);
|
|
394
|
-
exports.Role = Role = __decorate([
|
|
395
|
-
sequelize_typescript_1.Table
|
|
396
|
-
], Role);
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
/***/ }),
|
|
400
|
-
/* 15 */
|
|
401
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
405
|
-
exports.hasDuplicates = void 0;
|
|
406
|
-
const hasDuplicates = (arr, prop) => {
|
|
407
|
-
const seen = new Set();
|
|
408
|
-
return arr.some((obj) => {
|
|
409
|
-
const value = obj[prop];
|
|
410
|
-
if (seen.has(value)) {
|
|
411
|
-
return true;
|
|
412
|
-
}
|
|
413
|
-
seen.add(value);
|
|
414
|
-
return false;
|
|
415
|
-
});
|
|
416
|
-
};
|
|
417
|
-
exports.hasDuplicates = hasDuplicates;
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
/***/ }),
|
|
421
|
-
/* 16 */
|
|
422
|
-
/***/ ((module) => {
|
|
423
|
-
|
|
424
|
-
module.exports = require("@nestjs/config");
|
|
425
|
-
|
|
426
|
-
/***/ }),
|
|
427
|
-
/* 17 */
|
|
428
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
432
|
-
exports.TransactionResource = void 0;
|
|
433
|
-
exports.TransactionResource = {
|
|
434
|
-
name: 'Transaction',
|
|
435
|
-
actions: [
|
|
436
|
-
{
|
|
437
|
-
key: 'create',
|
|
438
|
-
description: 'Allows the User to create a new Transaction',
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
key: 'read',
|
|
442
|
-
description: 'Allows the user to read existing Transactions',
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
key: 'delete',
|
|
446
|
-
description: 'Allows the user to delete existing Transactions',
|
|
447
|
-
},
|
|
448
|
-
],
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
/***/ })
|
|
453
|
-
/******/ ]);
|
|
454
|
-
/************************************************************************/
|
|
455
|
-
/******/ // The module cache
|
|
456
|
-
/******/ var __webpack_module_cache__ = {};
|
|
457
|
-
/******/
|
|
458
|
-
/******/ // The require function
|
|
459
|
-
/******/ function __webpack_require__(moduleId) {
|
|
460
|
-
/******/ // Check if module is in cache
|
|
461
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
462
|
-
/******/ if (cachedModule !== undefined) {
|
|
463
|
-
/******/ return cachedModule.exports;
|
|
464
|
-
/******/ }
|
|
465
|
-
/******/ // Create a new module (and put it into the cache)
|
|
466
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
467
|
-
/******/ // no module.id needed
|
|
468
|
-
/******/ // no module.loaded needed
|
|
469
|
-
/******/ exports: {}
|
|
470
|
-
/******/ };
|
|
471
|
-
/******/
|
|
472
|
-
/******/ // Execute the module function
|
|
473
|
-
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
474
|
-
/******/
|
|
475
|
-
/******/ // Return the exports of the module
|
|
476
|
-
/******/ return module.exports;
|
|
477
|
-
/******/ }
|
|
478
|
-
/******/
|
|
479
|
-
/************************************************************************/
|
|
480
|
-
var __webpack_exports__ = {};
|
|
481
|
-
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
482
|
-
(() => {
|
|
483
|
-
var exports = __webpack_exports__;
|
|
484
|
-
|
|
485
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
486
|
-
const core_1 = __webpack_require__(1);
|
|
487
|
-
const app_module_1 = __webpack_require__(2);
|
|
488
|
-
async function bootstrap() {
|
|
489
|
-
const app = await core_1.NestFactory.create(app_module_1.AppModule);
|
|
490
|
-
await app.listen(process.env.PORT ?? 3000);
|
|
491
|
-
}
|
|
492
|
-
bootstrap();
|
|
493
|
-
|
|
494
|
-
})();
|
|
495
|
-
|
|
496
|
-
/******/ })()
|
|
497
|
-
;
|
package/eslint.config.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import eslint from '@eslint/js';
|
|
3
|
-
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
4
|
-
import globals from 'globals';
|
|
5
|
-
import tseslint from 'typescript-eslint';
|
|
6
|
-
|
|
7
|
-
export default tseslint.config(
|
|
8
|
-
{
|
|
9
|
-
ignores: ['eslint.config.mjs'],
|
|
10
|
-
},
|
|
11
|
-
eslint.configs.recommended,
|
|
12
|
-
...tseslint.configs.recommendedTypeChecked,
|
|
13
|
-
eslintPluginPrettierRecommended,
|
|
14
|
-
{
|
|
15
|
-
languageOptions: {
|
|
16
|
-
globals: {
|
|
17
|
-
...globals.node,
|
|
18
|
-
...globals.jest,
|
|
19
|
-
},
|
|
20
|
-
sourceType: 'commonjs',
|
|
21
|
-
parserOptions: {
|
|
22
|
-
projectService: true,
|
|
23
|
-
tsconfigRootDir: import.meta.dirname,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
rules: {
|
|
29
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
30
|
-
'@typescript-eslint/no-floating-promises': 'warn',
|
|
31
|
-
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
32
|
-
"prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
);
|
package/nest-cli.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
-
import { AppController } from './app.controller';
|
|
3
|
-
import { AppService } from './app.service';
|
|
4
|
-
|
|
5
|
-
describe('AppController', () => {
|
|
6
|
-
let appController: AppController;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
const app: TestingModule = await Test.createTestingModule({
|
|
10
|
-
controllers: [AppController],
|
|
11
|
-
providers: [AppService],
|
|
12
|
-
}).compile();
|
|
13
|
-
|
|
14
|
-
appController = app.get<AppController>(AppController);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('root', () => {
|
|
18
|
-
it('should return "Hello World!"', () => {
|
|
19
|
-
expect(appController.getHello()).toBe('Hello World!');
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|
package/src/app.controller.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Controller, Get } from '@nestjs/common';
|
|
2
|
-
import { AppService } from './app.service';
|
|
3
|
-
|
|
4
|
-
@Controller()
|
|
5
|
-
export class AppController {
|
|
6
|
-
constructor(private readonly appService: AppService) {}
|
|
7
|
-
|
|
8
|
-
@Get()
|
|
9
|
-
getHello(): string {
|
|
10
|
-
return this.appService.getHello();
|
|
11
|
-
}
|
|
12
|
-
}
|
package/src/app.module.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Module } from '@nestjs/common';
|
|
2
|
-
import { AppController } from './app.controller';
|
|
3
|
-
import { AppService } from './app.service';
|
|
4
|
-
import { SentinelModule } from '@app/sentinel';
|
|
5
|
-
import { TransactionResource } from './models/sentinel/TransactionResource';
|
|
6
|
-
import { TestResource } from './models/sentinel/TestResource';
|
|
7
|
-
|
|
8
|
-
@Module({
|
|
9
|
-
imports: [
|
|
10
|
-
SentinelModule.register({
|
|
11
|
-
resources: [TransactionResource],
|
|
12
|
-
}),
|
|
13
|
-
],
|
|
14
|
-
controllers: [AppController],
|
|
15
|
-
providers: [AppService],
|
|
16
|
-
})
|
|
17
|
-
export class AppModule {}
|
package/src/app.service.ts
DELETED
package/src/main.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SecuredResource,
|
|
3
|
-
SecuredResourceAction,
|
|
4
|
-
} from '@app/sentinel/models/SecuredResource';
|
|
5
|
-
|
|
6
|
-
export const TestResource: SecuredResource = {
|
|
7
|
-
name: 'Transaction',
|
|
8
|
-
actions: [
|
|
9
|
-
{
|
|
10
|
-
key: 'create',
|
|
11
|
-
description: 'Allows the User to create a new Transaction',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
key: 'read',
|
|
15
|
-
description: 'Allows the user to read existing Transactions',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
key: 'delete',
|
|
19
|
-
description: 'Allows the user to delete existing Transactions',
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SecuredResource,
|
|
3
|
-
SecuredResourceAction,
|
|
4
|
-
} from '@app/sentinel/models/SecuredResource';
|
|
5
|
-
|
|
6
|
-
export const TransactionResource: SecuredResource = {
|
|
7
|
-
name: 'Transaction',
|
|
8
|
-
actions: [
|
|
9
|
-
{
|
|
10
|
-
key: 'create',
|
|
11
|
-
description: 'Allows the User to create a new Transaction',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
key: 'read',
|
|
15
|
-
description: 'Allows the user to read existing Transactions',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
key: 'delete',
|
|
19
|
-
description: 'Allows the user to delete existing Transactions',
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
package/test/app.e2e-spec.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
-
import { INestApplication } from '@nestjs/common';
|
|
3
|
-
import request from 'supertest';
|
|
4
|
-
import { App } from 'supertest/types';
|
|
5
|
-
import { AppModule } from './../src/app.module';
|
|
6
|
-
|
|
7
|
-
describe('AppController (e2e)', () => {
|
|
8
|
-
let app: INestApplication<App>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
12
|
-
imports: [AppModule],
|
|
13
|
-
}).compile();
|
|
14
|
-
|
|
15
|
-
app = moduleFixture.createNestApplication();
|
|
16
|
-
await app.init();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('/ (GET)', () => {
|
|
20
|
-
return request(app.getHttpServer())
|
|
21
|
-
.get('/')
|
|
22
|
-
.expect(200)
|
|
23
|
-
.expect('Hello World!');
|
|
24
|
-
});
|
|
25
|
-
});
|
package/test/jest-e2e.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"moduleFileExtensions": [
|
|
3
|
-
"js",
|
|
4
|
-
"json",
|
|
5
|
-
"ts"
|
|
6
|
-
],
|
|
7
|
-
"rootDir": ".",
|
|
8
|
-
"testEnvironment": "node",
|
|
9
|
-
"testRegex": ".e2e-spec.ts$",
|
|
10
|
-
"transform": {
|
|
11
|
-
"^.+\\.(t|j)s$": "ts-jest"
|
|
12
|
-
},
|
|
13
|
-
"moduleNameMapper": {
|
|
14
|
-
"^@app/sentinel(|/.*)$": "<rootDir>/../libs/sentinel/src/$1"
|
|
15
|
-
}
|
|
16
|
-
}
|
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "nodenext",
|
|
4
|
-
"moduleResolution": "nodenext",
|
|
5
|
-
"resolvePackageJsonExports": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"isolatedModules": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"removeComments": true,
|
|
10
|
-
"emitDecoratorMetadata": true,
|
|
11
|
-
"experimentalDecorators": true,
|
|
12
|
-
"allowSyntheticDefaultImports": true,
|
|
13
|
-
"target": "ES2023",
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"outDir": "./dist",
|
|
16
|
-
"baseUrl": "./",
|
|
17
|
-
"incremental": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"strictNullChecks": true,
|
|
20
|
-
"forceConsistentCasingInFileNames": true,
|
|
21
|
-
"noImplicitAny": false,
|
|
22
|
-
"strictBindCallApply": false,
|
|
23
|
-
"noFallthroughCasesInSwitch": false,
|
|
24
|
-
"paths": {
|
|
25
|
-
"@app/sentinel": [
|
|
26
|
-
"libs/sentinel/src"
|
|
27
|
-
],
|
|
28
|
-
"@app/sentinel/*": [
|
|
29
|
-
"libs/sentinel/src/*"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|