@darraghor/nest-backend-libs 2.7.0 → 2.8.0
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/dist/authz/AccessToken.js +1 -2
- package/dist/authz/AuthConfigurationService.js +12 -15
- package/dist/authz/AuthConfigurationService.js.map +1 -1
- package/dist/authz/AuthConfigurationVariables.js +2 -4
- package/dist/authz/AuthConfigurationVariables.js.map +1 -1
- package/dist/authz/ClaimsAuthorisationGuard.js +7 -13
- package/dist/authz/ClaimsAuthorisationGuard.js.map +1 -1
- package/dist/authz/DefaultAuthGuard.js +5 -8
- package/dist/authz/DefaultAuthGuard.js.map +1 -1
- package/dist/authz/MandatoryUserClaims.decorator.js +2 -6
- package/dist/authz/MandatoryUserClaims.decorator.js.map +1 -1
- package/dist/authz/RequestWithUser.js +1 -2
- package/dist/authz/authz.module.js +17 -23
- package/dist/authz/authz.module.js.map +1 -1
- package/dist/authz/authzstrategy.js +16 -22
- package/dist/authz/authzstrategy.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationService.js +10 -13
- package/dist/authzclient/AuthClientConfigurationService.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationVariables.js +2 -4
- package/dist/authzclient/AuthClientConfigurationVariables.js.map +1 -1
- package/dist/authzclient/AuthzClientProvider.js +5 -8
- package/dist/authzclient/AuthzClientProvider.js.map +1 -1
- package/dist/authzclient/UserProfile.dto.js +1 -5
- package/dist/authzclient/UserProfile.dto.js.map +1 -1
- package/dist/authzclient/authz-client.module.js +13 -19
- package/dist/authzclient/authz-client.module.js.map +1 -1
- package/dist/authzclient/authz.service.js +8 -14
- package/dist/authzclient/authz.service.js.map +1 -1
- package/dist/cli/cli.js +7 -12
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/commands/WriteApiClientCommand.js +6 -13
- package/dist/cli/commands/WriteApiClientCommand.js.map +1 -1
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js +11 -18
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js.map +1 -1
- package/dist/configuration/ValidatedConfigurationService.js +5 -8
- package/dist/configuration/ValidatedConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfig.module.js +9 -15
- package/dist/core-config/CoreConfig.module.js.map +1 -1
- package/dist/core-config/CoreConfigurationService.js +22 -25
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfigurationVariables.js +2 -4
- package/dist/core-config/CoreConfigurationVariables.js.map +1 -1
- package/dist/database-postgres/PostgresDatabase.module.js +11 -14
- package/dist/database-postgres/PostgresDatabase.module.js.map +1 -1
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js +5 -8
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js.map +1 -1
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js +5 -12
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabase.module.js +11 -14
- package/dist/database-sqlite/SqliteDatabase.module.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js +5 -8
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js.map +1 -1
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js +5 -12
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/index.js +30 -64
- package/dist/index.js.map +1 -1
- package/dist/invitations/InvitationConfigurationService.js +10 -13
- package/dist/invitations/InvitationConfigurationService.js.map +1 -1
- package/dist/invitations/InvitationConfigurationVariables.js +2 -4
- package/dist/invitations/InvitationConfigurationVariables.js.map +1 -1
- package/dist/invitations/dto/create-invitation.dto.js +5 -9
- package/dist/invitations/dto/create-invitation.dto.js.map +1 -1
- package/dist/invitations/entities/invitation.entity.js +30 -33
- package/dist/invitations/entities/invitation.entity.js.map +1 -1
- package/dist/invitations/invitation.controller.js +21 -24
- package/dist/invitations/invitation.controller.js.map +1 -1
- package/dist/invitations/invitation.module.js +21 -27
- package/dist/invitations/invitation.module.js.map +1 -1
- package/dist/invitations/invitation.service.js +18 -21
- package/dist/invitations/invitation.service.js.map +1 -1
- package/dist/logger/CoreLoggerService.js +7 -9
- package/dist/logger/CoreLoggerService.js.map +1 -1
- package/dist/logger/LoggingConfigurationService.js +12 -15
- package/dist/logger/LoggingConfigurationService.js.map +1 -1
- package/dist/logger/LoggingConfigurationVariables.js +2 -4
- package/dist/logger/LoggingConfigurationVariables.js.map +1 -1
- package/dist/logger/LoggingInterceptor.js +7 -13
- package/dist/logger/LoggingInterceptor.js.map +1 -1
- package/dist/logger/logger.module.js +14 -20
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/organisation/dto/RolesEnum.js +2 -5
- package/dist/organisation/dto/RolesEnum.js.map +1 -1
- package/dist/organisation/dto/create-organisation.dto.js +7 -11
- package/dist/organisation/dto/create-organisation.dto.js.map +1 -1
- package/dist/organisation/dto/update-organisation.dto.js +3 -7
- package/dist/organisation/dto/update-organisation.dto.js.map +1 -1
- package/dist/organisation/entities/member-role.entity.js +20 -23
- package/dist/organisation/entities/member-role.entity.js.map +1 -1
- package/dist/organisation/entities/organisation-membership.entity.js +37 -40
- package/dist/organisation/entities/organisation-membership.entity.js.map +1 -1
- package/dist/organisation/entities/organisation.entity.js +26 -29
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/organisation/organisation.controller.js +29 -32
- package/dist/organisation/organisation.controller.js.map +1 -1
- package/dist/organisation/organisation.module.js +12 -15
- package/dist/organisation/organisation.module.js.map +1 -1
- package/dist/organisation/organisation.service.js +20 -23
- package/dist/organisation/organisation.service.js.map +1 -1
- package/dist/person/dto/create-person.dto.js +1 -5
- package/dist/person/dto/create-person.dto.js.map +1 -1
- package/dist/person/dto/update-person.dto.js +3 -7
- package/dist/person/dto/update-person.dto.js.map +1 -1
- package/dist/person/entities/person.entity.js +41 -44
- package/dist/person/entities/person.entity.js.map +1 -1
- package/dist/person/person.controller.js +25 -28
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.module.js +15 -18
- package/dist/person/person.module.js.map +1 -1
- package/dist/person/person.service.js +22 -28
- package/dist/person/person.service.js.map +1 -1
- package/dist/root-app/SwaggerGen.js +15 -21
- package/dist/root-app/SwaggerGen.js.map +1 -1
- package/dist/root-app/app.controller.js +17 -23
- package/dist/root-app/app.controller.js.map +1 -1
- package/dist/root-app/app.service.js +3 -6
- package/dist/root-app/app.service.js.map +1 -1
- package/dist/root-app/core-app.module.js +26 -32
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/root-app/notfound.interceptor.js +6 -9
- package/dist/root-app/notfound.interceptor.js.map +1 -1
- package/dist/runningCommandLine/CliCommandService.js +8 -14
- package/dist/runningCommandLine/CliCommandService.js.map +1 -1
- package/dist/runningCommandLine/RunningCommandLine.module.js +9 -12
- package/dist/runningCommandLine/RunningCommandLine.module.js.map +1 -1
- package/dist/smtp-email-client/EmailClientProvider.js +5 -8
- package/dist/smtp-email-client/EmailClientProvider.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.js +24 -27
- package/dist/smtp-email-client/EmailConfigurationService.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.js +2 -4
- package/dist/smtp-email-client/EmailConfigurationVariables.js.map +1 -1
- package/dist/smtp-email-client/email-client.service.js +15 -21
- package/dist/smtp-email-client/email-client.service.js.map +1 -1
- package/dist/smtp-email-client/email.controller.js +12 -15
- package/dist/smtp-email-client/email.controller.js.map +1 -1
- package/dist/smtp-email-client/email.entity.js +32 -35
- package/dist/smtp-email-client/email.entity.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.js +26 -32
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-handler.js +15 -21
- package/dist/smtp-email-client/smtp-email-handler.js.map +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.js +14 -17
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/StripeClientProvider.js +5 -11
- package/dist/stripe-client/StripeClientProvider.js.map +1 -1
- package/dist/stripe-client/StripeConfigurationVariables.js +2 -4
- package/dist/stripe-client/StripeConfigurationVariables.js.map +1 -1
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js +19 -24
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js.map +1 -1
- package/dist/stripe-client/services/stripe-checkout.service.js +10 -16
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/services/stripe-event-handler.js +12 -18
- package/dist/stripe-client/services/stripe-event-handler.js.map +1 -1
- package/dist/stripe-client/services/stripe-webhook-handler.service.js +13 -19
- package/dist/stripe-client/services/stripe-webhook-handler.service.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.js +22 -28
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-controller.js +27 -30
- package/dist/stripe-client/stripe-controller.js.map +1 -1
- package/dist/testing/preRun.js +1 -3
- package/dist/testing/preRun.js.map +1 -1
- package/dist/twitter-client/TwitterClientConfigurationService.js +16 -19
- package/dist/twitter-client/TwitterClientConfigurationService.js.map +1 -1
- package/dist/twitter-client/TwitterClientProvider.js +5 -8
- package/dist/twitter-client/TwitterClientProvider.js.map +1 -1
- package/dist/twitter-client/TwitterConfigurationVariables.js +2 -4
- package/dist/twitter-client/TwitterConfigurationVariables.js.map +1 -1
- package/dist/twitter-client/services/twitter-client.service.js +8 -14
- package/dist/twitter-client/services/twitter-client.service.js.map +1 -1
- package/dist/twitter-client/twitter-account.module.js +15 -21
- package/dist/twitter-client/twitter-account.module.js.map +1 -1
- package/package.json +1 -1
- package/dist/database-postgres/write-typeorm-config.d.ts +0 -2
- package/dist/database-postgres/write-typeorm-config.js +0 -14
- package/dist/database-postgres/write-typeorm-config.js.map +0 -1
- package/dist/database-sqlite/write-typeorm-config.d.ts +0 -1
- package/dist/database-sqlite/write-typeorm-config.js +0 -13
- package/dist/database-sqlite/write-typeorm-config.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,14 +10,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const person_entity_1 = require("./entities/person.entity");
|
|
21
|
-
const passport_1 = require("@nestjs/passport");
|
|
13
|
+
import { Controller, Get, Request, Body, Patch, Param, Delete, UseGuards, } from "@nestjs/common";
|
|
14
|
+
import { PersonService } from "./person.service";
|
|
15
|
+
import { UpdatePersonDto } from "./dto/update-person.dto";
|
|
16
|
+
import { ApiBearerAuth, ApiOkResponse, ApiTags } from "@nestjs/swagger";
|
|
17
|
+
import { Person } from "./entities/person.entity";
|
|
18
|
+
import { AuthGuard } from "@nestjs/passport";
|
|
22
19
|
let PersonController = class PersonController {
|
|
23
20
|
personService;
|
|
24
21
|
constructor(personService) {
|
|
@@ -36,38 +33,38 @@ let PersonController = class PersonController {
|
|
|
36
33
|
}
|
|
37
34
|
};
|
|
38
35
|
__decorate([
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
__param(0,
|
|
36
|
+
Get(),
|
|
37
|
+
ApiOkResponse({ type: Person }),
|
|
38
|
+
__param(0, Request()),
|
|
42
39
|
__metadata("design:type", Function),
|
|
43
40
|
__metadata("design:paramtypes", [Object]),
|
|
44
41
|
__metadata("design:returntype", Promise)
|
|
45
42
|
], PersonController.prototype, "findSelf", null);
|
|
46
43
|
__decorate([
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
__param(0,
|
|
50
|
-
__param(1,
|
|
51
|
-
__param(2,
|
|
44
|
+
Patch(":uuid"),
|
|
45
|
+
ApiOkResponse({ type: Person }),
|
|
46
|
+
__param(0, Param("uuid")),
|
|
47
|
+
__param(1, Body()),
|
|
48
|
+
__param(2, Request()),
|
|
52
49
|
__metadata("design:type", Function),
|
|
53
|
-
__metadata("design:paramtypes", [String,
|
|
50
|
+
__metadata("design:paramtypes", [String, UpdatePersonDto, Object]),
|
|
54
51
|
__metadata("design:returntype", Promise)
|
|
55
52
|
], PersonController.prototype, "update", null);
|
|
56
53
|
__decorate([
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
__param(0,
|
|
60
|
-
__param(1,
|
|
54
|
+
Delete(":uuid"),
|
|
55
|
+
ApiOkResponse({ type: Person }),
|
|
56
|
+
__param(0, Param("uuid")),
|
|
57
|
+
__param(1, Request()),
|
|
61
58
|
__metadata("design:type", Function),
|
|
62
59
|
__metadata("design:paramtypes", [String, Object]),
|
|
63
60
|
__metadata("design:returntype", Promise)
|
|
64
61
|
], PersonController.prototype, "remove", null);
|
|
65
62
|
PersonController = __decorate([
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
__metadata("design:paramtypes", [
|
|
63
|
+
UseGuards(AuthGuard("jwt")),
|
|
64
|
+
ApiBearerAuth(),
|
|
65
|
+
Controller("person"),
|
|
66
|
+
ApiTags("persons"),
|
|
67
|
+
__metadata("design:paramtypes", [PersonService])
|
|
71
68
|
], PersonController);
|
|
72
|
-
|
|
69
|
+
export { PersonController };
|
|
73
70
|
//# sourceMappingURL=person.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.controller.js","sourceRoot":"","sources":["../../src/person/person.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"person.controller.js","sourceRoot":"","sources":["../../src/person/person.controller.ts"],"names":[],"mapp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AAIK;IAFL,KAAK,CAAC,OAAO,CAAC;IACd,aAAa,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;IAEzB,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,OAAO,EAAE,CAAA;;6CADe,eAAe;;8CAQ3C;AAIK;IAFL,MAAM,CAAC,OAAO,CAAC;IACf,aAAa,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;IAEzB,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IACb,WAAA,OAAO,EAAE,CAAA;;;;8CAOb;AAlCQ,gBAAgB;IAJ5B,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,aAAa,EAAE;IACf,UAAU,CAAC,QAAQ,CAAC;IACpB,OAAO,CAAC,SAAS,CAAC;qCAE6B,aAAa;GADhD,gBAAgB,CAmC5B;SAnCY,gBAAgB"}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
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;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
16
|
-
const authz_client_module_1 = require("../authzclient/authz-client.module");
|
|
7
|
+
import { Module } from "@nestjs/common";
|
|
8
|
+
import { PersonService } from "./person.service";
|
|
9
|
+
import { PersonController } from "./person.controller";
|
|
10
|
+
import { Person } from "./entities/person.entity";
|
|
11
|
+
import { LoggerModule } from "../logger/logger.module";
|
|
12
|
+
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
13
|
+
import { AuthzClientModule } from "../authzclient/authz-client.module";
|
|
17
14
|
let PersonModule = class PersonModule {
|
|
18
15
|
};
|
|
19
16
|
PersonModule = __decorate([
|
|
20
|
-
|
|
17
|
+
Module({
|
|
21
18
|
imports: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
LoggerModule,
|
|
20
|
+
TypeOrmModule.forFeature([Person]),
|
|
21
|
+
AuthzClientModule,
|
|
25
22
|
],
|
|
26
|
-
controllers: [
|
|
27
|
-
providers: [
|
|
28
|
-
exports: [
|
|
23
|
+
controllers: [PersonController],
|
|
24
|
+
providers: [PersonService],
|
|
25
|
+
exports: [PersonService],
|
|
29
26
|
})
|
|
30
27
|
], PersonModule);
|
|
31
|
-
|
|
28
|
+
export { PersonModule };
|
|
32
29
|
//# sourceMappingURL=person.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.module.js","sourceRoot":"","sources":["../../src/person/person.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"person.module.js","sourceRoot":"","sources":["../../src/person/person.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAC,MAAM,oCAAoC,CAAC;AAY9D,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,YAAY;IAVxB,MAAM,CAAC;QACJ,OAAO,EAAE;YACL,YAAY;YACZ,aAAa,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;YAClC,iBAAiB;SACpB;QACD,WAAW,EAAE,CAAC,gBAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,aAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,aAAa,CAAC;KAC3B,CAAC;GACW,YAAY,CAAG;SAAf,YAAY"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,21 +10,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const RolesEnum_1 = require("../organisation/dto/RolesEnum");
|
|
25
|
-
const member_role_entity_1 = require("../organisation/entities/member-role.entity");
|
|
26
|
-
const organisation_membership_entity_1 = require("../organisation/entities/organisation-membership.entity");
|
|
27
|
-
const organisation_entity_1 = require("../organisation/entities/organisation.entity");
|
|
28
|
-
const person_entity_1 = require("./entities/person.entity");
|
|
13
|
+
import { Injectable, NotFoundException } from "@nestjs/common";
|
|
14
|
+
import { InjectRepository } from "@nestjs/typeorm";
|
|
15
|
+
import { Repository } from "typeorm";
|
|
16
|
+
import { AuthZClientService } from "../authzclient/authz.service";
|
|
17
|
+
import CoreLoggerService from "../logger/CoreLoggerService";
|
|
18
|
+
import { Roles } from "../organisation/dto/RolesEnum";
|
|
19
|
+
import { MembershipRole } from "../organisation/entities/member-role.entity";
|
|
20
|
+
import { OrganisationMembership } from "../organisation/entities/organisation-membership.entity";
|
|
21
|
+
import { Organisation } from "../organisation/entities/organisation.entity";
|
|
22
|
+
import { Person } from "./entities/person.entity";
|
|
29
23
|
let PersonService = class PersonService {
|
|
30
24
|
repository;
|
|
31
25
|
logger;
|
|
@@ -56,13 +50,13 @@ let PersonService = class PersonService {
|
|
|
56
50
|
return;
|
|
57
51
|
}
|
|
58
52
|
// create a new organisation
|
|
59
|
-
const unsavedOrganisation = new
|
|
53
|
+
const unsavedOrganisation = new Organisation();
|
|
60
54
|
unsavedOrganisation.name = `${auth0User.given_name ?? "My"} Organisation`;
|
|
61
55
|
// create roles
|
|
62
|
-
const ownerRole = new
|
|
63
|
-
ownerRole.name =
|
|
56
|
+
const ownerRole = new MembershipRole();
|
|
57
|
+
ownerRole.name = Roles.owner;
|
|
64
58
|
// create a new membership
|
|
65
|
-
const membership = new
|
|
59
|
+
const membership = new OrganisationMembership();
|
|
66
60
|
membership.organisation = unsavedOrganisation;
|
|
67
61
|
membership.roles = [ownerRole];
|
|
68
62
|
if (foundPerson !== undefined && foundPerson !== null) {
|
|
@@ -120,7 +114,7 @@ let PersonService = class PersonService {
|
|
|
120
114
|
},
|
|
121
115
|
},
|
|
122
116
|
});
|
|
123
|
-
if (user.memberships.some((m) => m.roles.some((r) => r.name ===
|
|
117
|
+
if (user.memberships.some((m) => m.roles.some((r) => r.name === Roles.owner))) {
|
|
124
118
|
throw new Error("Can't remove the owner of an organisation. Assign a new owner first.");
|
|
125
119
|
}
|
|
126
120
|
return this.repository.remove(user);
|
|
@@ -131,16 +125,16 @@ let PersonService = class PersonService {
|
|
|
131
125
|
currentUserUuid,
|
|
132
126
|
uuid,
|
|
133
127
|
});
|
|
134
|
-
throw new
|
|
128
|
+
throw new NotFoundException();
|
|
135
129
|
}
|
|
136
130
|
}
|
|
137
131
|
};
|
|
138
132
|
PersonService = __decorate([
|
|
139
|
-
|
|
140
|
-
__param(0,
|
|
141
|
-
__metadata("design:paramtypes", [
|
|
142
|
-
|
|
143
|
-
|
|
133
|
+
Injectable(),
|
|
134
|
+
__param(0, InjectRepository(Person)),
|
|
135
|
+
__metadata("design:paramtypes", [Repository,
|
|
136
|
+
CoreLoggerService,
|
|
137
|
+
AuthZClientService])
|
|
144
138
|
], PersonService);
|
|
145
|
-
|
|
139
|
+
export { PersonService };
|
|
146
140
|
//# sourceMappingURL=person.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.service.js","sourceRoot":"","sources":["../../src/person/person.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"person.service.js","sourceRoot":"","sources":["../../src/person/person.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAEhE,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,KAAK,EAAC,MAAM,+BAA+B,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAC,sBAAsB,EAAC,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAAC,YAAY,EAAC,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAGzC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGV;IACA;IACA;IAJZ,YAEY,UAA8B,EAC9B,MAAyB,EACzB,WAA+B;QAF/B,eAAU,GAAV,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AAM,CAAC,IAAI,CAAC,gBAAgB,eAAe,eAAe,EAAE;gBAC7D,eAAe;gBACf,IAAI;aACP,CAAC,CAAC;YACH,MAAM,IAAI,iBAAiB,EAAE,CAAC;SACjC;IACL,CAAC;CACJ,CAAA;AArJY,aAAa;IADzB,UAAU,EAAE;IAGJ,WAAA,gBAAgB,CAAC,MAAM,CAAC,CAAA;qCACL,UAAU;QACd,iBAAiB;QACZ,kBAAkB;GALlC,aAAa,CAqJzB;SArJY,aAAa"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,17 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
-
const fs_1 = __importDefault(require("fs"));
|
|
19
|
-
const child_process_1 = require("child_process");
|
|
20
|
-
const CoreLoggerService_1 = __importDefault(require("../logger/CoreLoggerService"));
|
|
21
|
-
const CoreConfigurationService_1 = require("../core-config/CoreConfigurationService");
|
|
10
|
+
import { Injectable } from "@nestjs/common";
|
|
11
|
+
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
|
|
12
|
+
import fs from "fs";
|
|
13
|
+
import { spawn } from "child_process";
|
|
14
|
+
import CoreLoggerService from "../logger/CoreLoggerService";
|
|
15
|
+
import { CoreConfigurationService } from "../core-config/CoreConfigurationService";
|
|
22
16
|
/* istanbul ignore next */
|
|
23
17
|
let SwaggerGen = class SwaggerGen {
|
|
24
18
|
logger;
|
|
@@ -32,18 +26,18 @@ let SwaggerGen = class SwaggerGen {
|
|
|
32
26
|
this.logger.log("Skipping swagger model generation for this environment");
|
|
33
27
|
return;
|
|
34
28
|
}
|
|
35
|
-
const config = new
|
|
29
|
+
const config = new DocumentBuilder()
|
|
36
30
|
.addBearerAuth()
|
|
37
31
|
.setTitle(this.config.appTitle)
|
|
38
32
|
.setDescription("Describes the backend api")
|
|
39
33
|
.build();
|
|
40
|
-
const document =
|
|
41
|
-
|
|
34
|
+
const document = SwaggerModule.createDocument(app, config);
|
|
35
|
+
SwaggerModule.setup("swagger", app, document);
|
|
42
36
|
// tslint:disable-next-line: non-literal-fs-path
|
|
43
|
-
|
|
37
|
+
fs.writeFileSync(pathToSave, JSON.stringify(document, undefined, 2));
|
|
44
38
|
this.logger.log(`Wrote swagger api doc to ${pathToSave}`);
|
|
45
39
|
if (this.config.shouldAutomaticallyInstallApiModels) {
|
|
46
|
-
const modelGenerator =
|
|
40
|
+
const modelGenerator = spawn("./node_modules/@darraghor/nest-backend-libs/dist/open-api-generation/generate.sh", {
|
|
47
41
|
stdio: ["ignore", "ignore", "inherit"],
|
|
48
42
|
shell: true,
|
|
49
43
|
});
|
|
@@ -54,11 +48,11 @@ let SwaggerGen = class SwaggerGen {
|
|
|
54
48
|
}
|
|
55
49
|
};
|
|
56
50
|
SwaggerGen = __decorate([
|
|
57
|
-
|
|
51
|
+
Injectable()
|
|
58
52
|
// eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
|
|
59
53
|
,
|
|
60
|
-
__metadata("design:paramtypes", [
|
|
61
|
-
|
|
54
|
+
__metadata("design:paramtypes", [CoreLoggerService,
|
|
55
|
+
CoreConfigurationService])
|
|
62
56
|
], SwaggerGen);
|
|
63
|
-
|
|
57
|
+
export { SwaggerGen };
|
|
64
58
|
//# sourceMappingURL=SwaggerGen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwaggerGen.js","sourceRoot":"","sources":["../../src/root-app/SwaggerGen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwaggerGen.js","sourceRoot":"","sources":["../../src/root-app/SwaggerGen.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAmB,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AACpC,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAEjF,0BAA0B;AAGnB,IAAM,UAAU,GAAhB,MAAM,UAAU;IAEP;IACA;IAFZ,YACY,MAAyB,EACzB,MAAgC;QADhC,WAAM,GAAN,MAAM,CAAmB;QACzB,WAAM,GAAN,MAAM,CAA0B;IACzC,CAAC;IAEG,QAAQ,CAAC,GAAqB,EAAE,UAAkB;QACrD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACpC,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,wDAAwD,CAC3D,CAAC;YACF,OAAO;SACV;QACD,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE;aAC/B,aAAa,EAAE;aACf,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;aAC9B,cAAc,CAAC,2BAA2B,CAAC;aAC3C,KAAK,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC3D,aAAa,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAE9C,gDAAgD;QAChD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,UAAU,EAAE,CAAC,CAAC;QAC1D,IAAI,IAAI,CAAC,MAAM,CAAC,mCAAmC,EAAE;YACjD,MAAM,cAAc,GAAG,KAAK,CACxB,kFAAkF,EAClF;gBACI,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;gBACtC,KAAK,EAAE,IAAI;aACd,CACJ,CAAC;YAEF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;gBAC3B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;SACN;IACL,CAAC;CACJ,CAAA;AAtCY,UAAU;IAFtB,UAAU,EAAE;IACb,iFAAiF;;qCAGzD,iBAAiB;QACjB,wBAAwB;GAHnC,UAAU,CAsCtB;SAtCY,UAAU"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,16 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const common_1 = require("@nestjs/common");
|
|
20
|
-
const passport_1 = require("@nestjs/passport");
|
|
21
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
22
|
-
const CoreLoggerService_1 = __importDefault(require("../logger/CoreLoggerService"));
|
|
23
|
-
const app_service_1 = require("./app.service");
|
|
13
|
+
import { Controller, Get, UseGuards, Request } from "@nestjs/common";
|
|
14
|
+
import { AuthGuard } from "@nestjs/passport";
|
|
15
|
+
import { ApiBearerAuth, ApiOkResponse, ApiTags } from "@nestjs/swagger";
|
|
16
|
+
import CoreLoggerService from "../logger/CoreLoggerService";
|
|
17
|
+
import { AppService } from "./app.service";
|
|
24
18
|
let AppController = class AppController {
|
|
25
19
|
appService;
|
|
26
20
|
logger;
|
|
@@ -39,27 +33,27 @@ let AppController = class AppController {
|
|
|
39
33
|
}
|
|
40
34
|
};
|
|
41
35
|
__decorate([
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
Get(),
|
|
37
|
+
ApiOkResponse({ type: String }),
|
|
44
38
|
__metadata("design:type", Function),
|
|
45
39
|
__metadata("design:paramtypes", []),
|
|
46
40
|
__metadata("design:returntype", String)
|
|
47
41
|
], AppController.prototype, "getHello", null);
|
|
48
42
|
__decorate([
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
__param(0,
|
|
43
|
+
UseGuards(AuthGuard("jwt")),
|
|
44
|
+
ApiBearerAuth(),
|
|
45
|
+
Get("authorise"),
|
|
46
|
+
ApiOkResponse({ type: String }),
|
|
47
|
+
__param(0, Request()),
|
|
54
48
|
__metadata("design:type", Function),
|
|
55
49
|
__metadata("design:paramtypes", [Object]),
|
|
56
50
|
__metadata("design:returntype", String)
|
|
57
51
|
], AppController.prototype, "getHelloAuthorized", null);
|
|
58
52
|
AppController = __decorate([
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
__metadata("design:paramtypes", [
|
|
62
|
-
|
|
53
|
+
Controller(),
|
|
54
|
+
ApiTags("Application Support"),
|
|
55
|
+
__metadata("design:paramtypes", [AppService,
|
|
56
|
+
CoreLoggerService])
|
|
63
57
|
], AppController);
|
|
64
|
-
|
|
58
|
+
export { AppController };
|
|
65
59
|
//# sourceMappingURL=app.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/root-app/app.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/root-app/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAEtE,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAIlC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAED;IACA;IAFrB,YACqB,UAAsB,EACtB,MAAyB;QADzB,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAmB;IAC3C,CAAC;IAIJ,QAAQ;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAMD,kBAAkB,CAAY,OAAwB;QAClD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC9C,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;QAC/C,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAA;AAhBG;IAAC,GAAG,EAAE;IACL,aAAa,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;;;6CAG7B;AAED;IAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,aAAa,EAAE;IACf,GAAG,CAAC,WAAW,CAAC;IAChB,aAAa,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;IACV,WAAA,OAAO,EAAE,CAAA;;;;uDAK5B;AArBQ,aAAa;IAFzB,UAAU,EAAE;IACZ,OAAO,CAAC,qBAAqB,CAAC;qCAGM,UAAU;QACd,iBAAiB;GAHrC,aAAa,CAsBzB;SAtBY,aAAa"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
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;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
exports.AppService = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
7
|
+
import { Injectable } from "@nestjs/common";
|
|
11
8
|
let AppService = class AppService {
|
|
12
9
|
getHello() {
|
|
13
10
|
return "Hello World!";
|
|
14
11
|
}
|
|
15
12
|
};
|
|
16
13
|
AppService = __decorate([
|
|
17
|
-
|
|
14
|
+
Injectable()
|
|
18
15
|
], AppService);
|
|
19
|
-
|
|
16
|
+
export { AppService };
|
|
20
17
|
//# sourceMappingURL=app.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/root-app/app.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/root-app/app.service.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAGnC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACnB,QAAQ;QACJ,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ,CAAA;AAJY,UAAU;IADtB,UAAU,EAAE;GACA,UAAU,CAItB;SAJY,UAAU"}
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
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;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CoreModule = void 0;
|
|
13
7
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
14
8
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
15
9
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
import "reflect-metadata";
|
|
11
|
+
import { ClassSerializerInterceptor, Module, ValidationPipe, } from "@nestjs/common";
|
|
12
|
+
import { LoggerModule } from "../logger/logger.module";
|
|
13
|
+
import { AppController } from "./app.controller";
|
|
14
|
+
import { AppService } from "./app.service";
|
|
15
|
+
import { SwaggerGen } from "./SwaggerGen";
|
|
16
|
+
import { NestFactory, Reflector } from "@nestjs/core";
|
|
17
|
+
import CoreLoggerService from "../logger/CoreLoggerService";
|
|
18
|
+
import { CoreConfigurationService } from "../core-config/CoreConfigurationService";
|
|
19
|
+
import { LoggingInterceptor } from "../logger/LoggingInterceptor";
|
|
20
|
+
import { CoreConfigModule } from "../core-config/CoreConfig.module";
|
|
21
|
+
import { ConfigModule } from "@nestjs/config";
|
|
28
22
|
let CoreModule = class CoreModule {
|
|
29
23
|
static initApplication(
|
|
30
24
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types,@typescript-eslint/no-explicit-any
|
|
@@ -33,22 +27,22 @@ let CoreModule = class CoreModule {
|
|
|
33
27
|
options) {
|
|
34
28
|
void (async () => {
|
|
35
29
|
try {
|
|
36
|
-
const app = await
|
|
30
|
+
const app = await NestFactory.create(rootModule, {
|
|
37
31
|
bodyParser: true,
|
|
38
32
|
});
|
|
39
|
-
const loggerService = app.get(
|
|
40
|
-
const configService = app.get(
|
|
33
|
+
const loggerService = app.get(CoreLoggerService);
|
|
34
|
+
const configService = app.get(CoreConfigurationService);
|
|
41
35
|
app.useLogger(loggerService);
|
|
42
36
|
app.enableCors({ origin: configService.frontEndAppUrl });
|
|
43
|
-
app.useGlobalPipes(new
|
|
37
|
+
app.useGlobalPipes(new ValidationPipe({
|
|
44
38
|
transform: true,
|
|
45
39
|
skipMissingProperties: false,
|
|
46
40
|
whitelist: true,
|
|
47
41
|
forbidNonWhitelisted: true,
|
|
48
42
|
forbidUnknownValues: true,
|
|
49
43
|
}));
|
|
50
|
-
app.useGlobalInterceptors(new
|
|
51
|
-
const swaggerGen = app.get(
|
|
44
|
+
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)), new LoggingInterceptor(loggerService));
|
|
45
|
+
const swaggerGen = app.get(SwaggerGen);
|
|
52
46
|
swaggerGen.generate(app, "open-api/swagger.json");
|
|
53
47
|
loggerService.log(`will listen on port ${configService.webPort} (DEV: http://localhost:${configService.webPort} )`);
|
|
54
48
|
loggerService.log(`swagger will be available at (DEV: http://localhost:${configService.webPort}/swagger )`);
|
|
@@ -66,16 +60,16 @@ let CoreModule = class CoreModule {
|
|
|
66
60
|
}
|
|
67
61
|
};
|
|
68
62
|
CoreModule = __decorate([
|
|
69
|
-
|
|
63
|
+
Module({
|
|
70
64
|
imports: [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
ConfigModule.forRoot({ cache: true }),
|
|
66
|
+
LoggerModule,
|
|
67
|
+
CoreConfigModule,
|
|
74
68
|
],
|
|
75
|
-
controllers: [
|
|
76
|
-
providers: [
|
|
77
|
-
exports: [
|
|
69
|
+
controllers: [AppController],
|
|
70
|
+
providers: [AppService, SwaggerGen],
|
|
71
|
+
exports: [SwaggerGen],
|
|
78
72
|
})
|
|
79
73
|
], CoreModule);
|
|
80
|
-
|
|
74
|
+
export { CoreModule };
|
|
81
75
|
//# sourceMappingURL=core-app.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-app.module.js","sourceRoot":"","sources":["../../src/root-app/core-app.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-app.module.js","sourceRoot":"","sources":["../../src/root-app/core-app.module.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAsD;AACtD,+DAA+D;AAC/D,4DAA4D;AAC5D,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EACH,0BAA0B,EAE1B,MAAM,EAEN,cAAc,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,WAAW,E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G,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBACvC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;gBAElD,aAAa,CAAC,GAAG,CACb,uBAAuB,aAAa,CAAC,OAAO,2BAA2B,aAAa,CAAC,OAAO,IAAI,CACnG,CAAC;gBACF,aAAa,CAAC,GAAG,CACb,uDAAuD,aAAa,CAAC,OAAO,YAAY,CAC3F,CAAC;gBAEF,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;aACvB;YAAC,OAAO,mBAAmB,EAAE;gBAC1B,uEAAuE;gBACvE,OAAO,CAAC,KAAK;gBACT,4EAA4E;gBAC5E,iCAAiC,mBAAmB,EAAE,CACzD,CAAC;gBACF,mDAAmD;gBACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;QACL,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;CACJ,CAAA;AAtDY,UAAU;IAVtB,MAAM,CAAC;QACJ,OAAO,EAAE;YACL,YAAY,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;YACnC,YAAY;YACZ,gBAAgB;SACnB;QACD,WAAW,EAAE,CAAC,aAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QACnC,OAAO,EAAE,CAAC,UAAU,CAAC;KACxB,CAAC;GACW,UAAU,CAsDtB;SAtDY,UAAU"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,26 +7,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const operators_1 = require("rxjs/operators");
|
|
10
|
+
import { Injectable, NotFoundException, } from "@nestjs/common";
|
|
11
|
+
import { tap } from "rxjs/operators";
|
|
15
12
|
let NotFoundInterceptor = class NotFoundInterceptor {
|
|
16
13
|
errorMessage;
|
|
17
14
|
constructor(errorMessage) {
|
|
18
15
|
this.errorMessage = errorMessage;
|
|
19
16
|
}
|
|
20
17
|
intercept(context, stream$) {
|
|
21
|
-
return stream$.handle().pipe(
|
|
18
|
+
return stream$.handle().pipe(tap((data) => {
|
|
22
19
|
if (data === undefined) {
|
|
23
|
-
throw new
|
|
20
|
+
throw new NotFoundException(this.errorMessage);
|
|
24
21
|
}
|
|
25
22
|
}));
|
|
26
23
|
}
|
|
27
24
|
};
|
|
28
25
|
NotFoundInterceptor = __decorate([
|
|
29
|
-
|
|
26
|
+
Injectable(),
|
|
30
27
|
__metadata("design:paramtypes", [String])
|
|
31
28
|
], NotFoundInterceptor);
|
|
32
|
-
|
|
29
|
+
export { NotFoundInterceptor };
|
|
33
30
|
//# sourceMappingURL=notfound.interceptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notfound.interceptor.js","sourceRoot":"","sources":["../../src/root-app/notfound.interceptor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notfound.interceptor.js","sourceRoot":"","sources":["../../src/root-app/notfound.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,UAAU,EAGV,iBAAiB,GAEpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AAG5B,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACR;IAApB,YAAoB,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;IAAG,CAAC;IAE5C,SAAS,CACL,OAAyB,EACzB,OAAoB;QAEpB,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CACxB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACT,IAAI,IAAI,KAAK,SAAS,EAAE;gBACpB,MAAM,IAAI,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aAClD;QACL,CAAC,CAAC,CACL,CAAC;IACN,CAAC;CACJ,CAAA;AAfY,mBAAmB;IAD/B,UAAU,EAAE;;GACA,mBAAmB,CAe/B;SAfY,mBAAmB"}
|