@darraghor/nest-backend-libs 2.8.0 → 2.10.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 +2 -1
- package/dist/authz/AuthConfigurationService.js +15 -12
- package/dist/authz/AuthConfigurationService.js.map +1 -1
- package/dist/authz/AuthConfigurationVariables.js +4 -2
- package/dist/authz/AuthConfigurationVariables.js.map +1 -1
- package/dist/authz/ClaimsAuthorisationGuard.js +13 -7
- package/dist/authz/ClaimsAuthorisationGuard.js.map +1 -1
- package/dist/authz/DefaultAuthGuard.js +8 -5
- package/dist/authz/DefaultAuthGuard.js.map +1 -1
- package/dist/authz/MandatoryUserClaims.decorator.js +6 -2
- package/dist/authz/MandatoryUserClaims.decorator.js.map +1 -1
- package/dist/authz/RequestWithUser.js +2 -1
- package/dist/authz/authz.module.js +23 -17
- package/dist/authz/authz.module.js.map +1 -1
- package/dist/authz/authzstrategy.js +22 -16
- package/dist/authz/authzstrategy.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationService.js +13 -10
- package/dist/authzclient/AuthClientConfigurationService.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationVariables.js +4 -2
- package/dist/authzclient/AuthClientConfigurationVariables.js.map +1 -1
- package/dist/authzclient/AuthzClientProvider.js +8 -5
- package/dist/authzclient/AuthzClientProvider.js.map +1 -1
- package/dist/authzclient/UserProfile.dto.js +5 -1
- package/dist/authzclient/UserProfile.dto.js.map +1 -1
- package/dist/authzclient/authz-client.module.js +19 -13
- package/dist/authzclient/authz-client.module.js.map +1 -1
- package/dist/authzclient/authz.service.js +14 -8
- package/dist/authzclient/authz.service.js.map +1 -1
- package/dist/cli/cli.js +12 -7
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/commands/WriteApiClientCommand.d.ts +3 -0
- package/dist/cli/commands/WriteApiClientCommand.js +24 -7
- package/dist/cli/commands/WriteApiClientCommand.js.map +1 -1
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js +18 -11
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js.map +1 -1
- package/dist/configuration/ValidatedConfigurationService.js +8 -5
- package/dist/configuration/ValidatedConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfig.module.js +15 -9
- package/dist/core-config/CoreConfig.module.js.map +1 -1
- package/dist/core-config/CoreConfigurationService.js +25 -22
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfigurationVariables.js +4 -2
- package/dist/core-config/CoreConfigurationVariables.js.map +1 -1
- package/dist/database-postgres/PostgresDatabase.module.js +14 -11
- package/dist/database-postgres/PostgresDatabase.module.js.map +1 -1
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js +8 -5
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js.map +1 -1
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js +12 -5
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabase.module.js +14 -11
- package/dist/database-sqlite/SqliteDatabase.module.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js +8 -5
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js.map +1 -1
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js +12 -5
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/index.js +64 -30
- package/dist/index.js.map +1 -1
- package/dist/invitations/InvitationConfigurationService.js +13 -10
- package/dist/invitations/InvitationConfigurationService.js.map +1 -1
- package/dist/invitations/InvitationConfigurationVariables.js +4 -2
- package/dist/invitations/InvitationConfigurationVariables.js.map +1 -1
- package/dist/invitations/dto/create-invitation.dto.js +9 -5
- package/dist/invitations/dto/create-invitation.dto.js.map +1 -1
- package/dist/invitations/entities/invitation.entity.js +33 -30
- package/dist/invitations/entities/invitation.entity.js.map +1 -1
- package/dist/invitations/invitation.controller.js +24 -21
- package/dist/invitations/invitation.controller.js.map +1 -1
- package/dist/invitations/invitation.module.js +27 -21
- package/dist/invitations/invitation.module.js.map +1 -1
- package/dist/invitations/invitation.service.js +21 -18
- package/dist/invitations/invitation.service.js.map +1 -1
- package/dist/logger/CoreLoggerService.js +9 -7
- package/dist/logger/CoreLoggerService.js.map +1 -1
- package/dist/logger/LoggingConfigurationService.js +15 -12
- package/dist/logger/LoggingConfigurationService.js.map +1 -1
- package/dist/logger/LoggingConfigurationVariables.js +4 -2
- package/dist/logger/LoggingConfigurationVariables.js.map +1 -1
- package/dist/logger/LoggingInterceptor.js +13 -7
- package/dist/logger/LoggingInterceptor.js.map +1 -1
- package/dist/logger/logger.module.js +20 -14
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/organisation/dto/RolesEnum.js +5 -2
- package/dist/organisation/dto/RolesEnum.js.map +1 -1
- package/dist/organisation/dto/create-organisation.dto.js +11 -7
- package/dist/organisation/dto/create-organisation.dto.js.map +1 -1
- package/dist/organisation/dto/update-organisation.dto.js +7 -3
- package/dist/organisation/dto/update-organisation.dto.js.map +1 -1
- package/dist/organisation/entities/member-role.entity.js +23 -20
- package/dist/organisation/entities/member-role.entity.js.map +1 -1
- package/dist/organisation/entities/organisation-membership.entity.js +40 -37
- package/dist/organisation/entities/organisation-membership.entity.js.map +1 -1
- package/dist/organisation/entities/organisation.entity.js +29 -26
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/organisation/organisation.controller.js +32 -29
- package/dist/organisation/organisation.controller.js.map +1 -1
- package/dist/organisation/organisation.module.js +15 -12
- package/dist/organisation/organisation.module.js.map +1 -1
- package/dist/organisation/organisation.service.js +23 -20
- package/dist/organisation/organisation.service.js.map +1 -1
- package/dist/person/dto/create-person.dto.js +5 -1
- package/dist/person/dto/create-person.dto.js.map +1 -1
- package/dist/person/dto/update-person.dto.js +7 -3
- package/dist/person/dto/update-person.dto.js.map +1 -1
- package/dist/person/entities/person.entity.js +44 -41
- package/dist/person/entities/person.entity.js.map +1 -1
- package/dist/person/person.controller.js +28 -25
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.module.js +18 -15
- package/dist/person/person.module.js.map +1 -1
- package/dist/person/person.service.js +28 -22
- package/dist/person/person.service.js.map +1 -1
- package/dist/root-app/SwaggerGen.js +21 -15
- package/dist/root-app/SwaggerGen.js.map +1 -1
- package/dist/root-app/app.controller.js +23 -17
- package/dist/root-app/app.controller.js.map +1 -1
- package/dist/root-app/app.service.js +6 -3
- package/dist/root-app/app.service.js.map +1 -1
- package/dist/root-app/core-app.module.js +32 -26
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/root-app/notfound.interceptor.js +9 -6
- package/dist/root-app/notfound.interceptor.js.map +1 -1
- package/dist/runningCommandLine/CliCommandService.js +14 -8
- package/dist/runningCommandLine/CliCommandService.js.map +1 -1
- package/dist/runningCommandLine/RunningCommandLine.module.js +12 -9
- package/dist/runningCommandLine/RunningCommandLine.module.js.map +1 -1
- package/dist/smtp-email-client/EmailClientProvider.js +8 -5
- package/dist/smtp-email-client/EmailClientProvider.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.js +27 -24
- package/dist/smtp-email-client/EmailConfigurationService.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.js +4 -2
- package/dist/smtp-email-client/EmailConfigurationVariables.js.map +1 -1
- package/dist/smtp-email-client/email-client.service.js +21 -15
- package/dist/smtp-email-client/email-client.service.js.map +1 -1
- package/dist/smtp-email-client/email.controller.js +15 -12
- package/dist/smtp-email-client/email.controller.js.map +1 -1
- package/dist/smtp-email-client/email.entity.js +35 -32
- package/dist/smtp-email-client/email.entity.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.js +32 -26
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-handler.js +21 -15
- package/dist/smtp-email-client/smtp-email-handler.js.map +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.js +17 -14
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/StripeClientProvider.js +11 -5
- package/dist/stripe-client/StripeClientProvider.js.map +1 -1
- package/dist/stripe-client/StripeConfigurationVariables.js +4 -2
- package/dist/stripe-client/StripeConfigurationVariables.js.map +1 -1
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js +24 -19
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js.map +1 -1
- package/dist/stripe-client/services/stripe-checkout.service.js +16 -10
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/services/stripe-event-handler.js +18 -12
- package/dist/stripe-client/services/stripe-event-handler.js.map +1 -1
- package/dist/stripe-client/services/stripe-webhook-handler.service.js +19 -13
- package/dist/stripe-client/services/stripe-webhook-handler.service.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.js +28 -22
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-controller.js +30 -27
- package/dist/stripe-client/stripe-controller.js.map +1 -1
- package/dist/testing/preRun.js +3 -1
- package/dist/testing/preRun.js.map +1 -1
- package/dist/twitter-client/TwitterClientConfigurationService.js +19 -16
- package/dist/twitter-client/TwitterClientConfigurationService.js.map +1 -1
- package/dist/twitter-client/TwitterClientProvider.js +8 -5
- package/dist/twitter-client/TwitterClientProvider.js.map +1 -1
- package/dist/twitter-client/TwitterConfigurationVariables.js +4 -2
- package/dist/twitter-client/TwitterConfigurationVariables.js.map +1 -1
- package/dist/twitter-client/services/twitter-client.service.js +14 -8
- package/dist/twitter-client/services/twitter-client.service.js.map +1 -1
- package/dist/twitter-client/twitter-account.module.js +21 -15
- package/dist/twitter-client/twitter-account.module.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -10,12 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PersonController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const person_service_1 = require("./person.service");
|
|
18
|
+
const update_person_dto_1 = require("./dto/update-person.dto");
|
|
19
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
20
|
+
const person_entity_1 = require("./entities/person.entity");
|
|
21
|
+
const passport_1 = require("@nestjs/passport");
|
|
19
22
|
let PersonController = class PersonController {
|
|
20
23
|
personService;
|
|
21
24
|
constructor(personService) {
|
|
@@ -33,38 +36,38 @@ let PersonController = class PersonController {
|
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
38
|
__decorate([
|
|
36
|
-
Get(),
|
|
37
|
-
ApiOkResponse({ type: Person }),
|
|
38
|
-
__param(0, Request()),
|
|
39
|
+
(0, common_1.Get)(),
|
|
40
|
+
(0, swagger_1.ApiOkResponse)({ type: person_entity_1.Person }),
|
|
41
|
+
__param(0, (0, common_1.Request)()),
|
|
39
42
|
__metadata("design:type", Function),
|
|
40
43
|
__metadata("design:paramtypes", [Object]),
|
|
41
44
|
__metadata("design:returntype", Promise)
|
|
42
45
|
], PersonController.prototype, "findSelf", null);
|
|
43
46
|
__decorate([
|
|
44
|
-
Patch(":uuid"),
|
|
45
|
-
ApiOkResponse({ type: Person }),
|
|
46
|
-
__param(0, Param("uuid")),
|
|
47
|
-
__param(1, Body()),
|
|
48
|
-
__param(2, Request()),
|
|
47
|
+
(0, common_1.Patch)(":uuid"),
|
|
48
|
+
(0, swagger_1.ApiOkResponse)({ type: person_entity_1.Person }),
|
|
49
|
+
__param(0, (0, common_1.Param)("uuid")),
|
|
50
|
+
__param(1, (0, common_1.Body)()),
|
|
51
|
+
__param(2, (0, common_1.Request)()),
|
|
49
52
|
__metadata("design:type", Function),
|
|
50
|
-
__metadata("design:paramtypes", [String, UpdatePersonDto, Object]),
|
|
53
|
+
__metadata("design:paramtypes", [String, update_person_dto_1.UpdatePersonDto, Object]),
|
|
51
54
|
__metadata("design:returntype", Promise)
|
|
52
55
|
], PersonController.prototype, "update", null);
|
|
53
56
|
__decorate([
|
|
54
|
-
Delete(":uuid"),
|
|
55
|
-
ApiOkResponse({ type: Person }),
|
|
56
|
-
__param(0, Param("uuid")),
|
|
57
|
-
__param(1, Request()),
|
|
57
|
+
(0, common_1.Delete)(":uuid"),
|
|
58
|
+
(0, swagger_1.ApiOkResponse)({ type: person_entity_1.Person }),
|
|
59
|
+
__param(0, (0, common_1.Param)("uuid")),
|
|
60
|
+
__param(1, (0, common_1.Request)()),
|
|
58
61
|
__metadata("design:type", Function),
|
|
59
62
|
__metadata("design:paramtypes", [String, Object]),
|
|
60
63
|
__metadata("design:returntype", Promise)
|
|
61
64
|
], PersonController.prototype, "remove", null);
|
|
62
65
|
PersonController = __decorate([
|
|
63
|
-
UseGuards(AuthGuard("jwt")),
|
|
64
|
-
ApiBearerAuth(),
|
|
65
|
-
Controller("person"),
|
|
66
|
-
ApiTags("persons"),
|
|
67
|
-
__metadata("design:paramtypes", [PersonService])
|
|
66
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
|
|
67
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
68
|
+
(0, common_1.Controller)("person"),
|
|
69
|
+
(0, swagger_1.ApiTags)("persons"),
|
|
70
|
+
__metadata("design:paramtypes", [person_service_1.PersonService])
|
|
68
71
|
], PersonController);
|
|
69
|
-
|
|
72
|
+
exports.PersonController = PersonController;
|
|
70
73
|
//# 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":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,qDAA+C;AAC/C,+DAAwD;AACxD,6CAAsE;AACtE,4DAAgD;AAChD,+CAA2C;AAMpC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACI;IAA7B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAIvD,AAAN,KAAK,CAAC,QAAQ,CAAY,OAAwB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACO,IAAY,EACnB,eAAgC,EAC7B,OAAwB;QAEnC,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAC5B,IAAI,EACJ,eAAe,EACf,OAAO,CAAC,IAAI,CAAC,IAAI,CACpB,CAAC;IACN,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACO,IAAY,EAChB,OAAwB;QAEnC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAChD,IAAI,EACJ,OAAO,CAAC,IAAI,CAAC,IAAI,CACpB,CAAC;QACF,OAAO,YAAY,KAAK,SAAS,CAAC;IACtC,CAAC;CACJ,CAAA;AA9BS;IAFL,IAAA,YAAG,GAAE;IACL,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,sBAAM,EAAC,CAAC;IACd,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;gDAExB;AAIK;IAFL,IAAA,cAAK,EAAC,OAAO,CAAC;IACd,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,sBAAM,EAAC,CAAC;IAEzB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,gBAAO,GAAE,CAAA;;6CADe,mCAAe;;8CAQ3C;AAIK;IAFL,IAAA,eAAM,EAAC,OAAO,CAAC;IACf,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,sBAAM,EAAC,CAAC;IAEzB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;8CAOb;AAlCQ,gBAAgB;IAJ5B,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,iBAAO,EAAC,SAAS,CAAC;qCAE6B,8BAAa;GADhD,gBAAgB,CAmC5B;AAnCY,4CAAgB"}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
5
|
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;
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PersonModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const person_service_1 = require("./person.service");
|
|
12
|
+
const person_controller_1 = require("./person.controller");
|
|
13
|
+
const person_entity_1 = require("./entities/person.entity");
|
|
14
|
+
const logger_module_1 = require("../logger/logger.module");
|
|
15
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
16
|
+
const authz_client_module_1 = require("../authzclient/authz-client.module");
|
|
14
17
|
let PersonModule = class PersonModule {
|
|
15
18
|
};
|
|
16
19
|
PersonModule = __decorate([
|
|
17
|
-
Module({
|
|
20
|
+
(0, common_1.Module)({
|
|
18
21
|
imports: [
|
|
19
|
-
LoggerModule,
|
|
20
|
-
TypeOrmModule.forFeature([Person]),
|
|
21
|
-
AuthzClientModule,
|
|
22
|
+
logger_module_1.LoggerModule,
|
|
23
|
+
typeorm_1.TypeOrmModule.forFeature([person_entity_1.Person]),
|
|
24
|
+
authz_client_module_1.AuthzClientModule,
|
|
22
25
|
],
|
|
23
|
-
controllers: [PersonController],
|
|
24
|
-
providers: [PersonService],
|
|
25
|
-
exports: [PersonService],
|
|
26
|
+
controllers: [person_controller_1.PersonController],
|
|
27
|
+
providers: [person_service_1.PersonService],
|
|
28
|
+
exports: [person_service_1.PersonService],
|
|
26
29
|
})
|
|
27
30
|
], PersonModule);
|
|
28
|
-
|
|
31
|
+
exports.PersonModule = PersonModule;
|
|
29
32
|
//# 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,2CAAsC;AACtC,qDAA+C;AAC/C,2DAAqD;AACrD,4DAAgD;AAChD,2DAAqD;AACrD,6CAA8C;AAC9C,4EAAqE;AAY9D,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,YAAY;IAVxB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,4BAAY;YACZ,uBAAa,CAAC,UAAU,CAAC,CAAC,sBAAM,CAAC,CAAC;YAClC,uCAAiB;SACpB;QACD,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KAC3B,CAAC;GACW,YAAY,CAAG;AAAf,oCAAY"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -10,16 +11,21 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PersonService = void 0;
|
|
19
|
+
const common_1 = require("@nestjs/common");
|
|
20
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
21
|
+
const typeorm_2 = require("typeorm");
|
|
22
|
+
const authz_service_1 = require("../authzclient/authz.service");
|
|
23
|
+
const CoreLoggerService_1 = __importDefault(require("../logger/CoreLoggerService"));
|
|
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");
|
|
23
29
|
let PersonService = class PersonService {
|
|
24
30
|
repository;
|
|
25
31
|
logger;
|
|
@@ -50,13 +56,13 @@ let PersonService = class PersonService {
|
|
|
50
56
|
return;
|
|
51
57
|
}
|
|
52
58
|
// create a new organisation
|
|
53
|
-
const unsavedOrganisation = new Organisation();
|
|
59
|
+
const unsavedOrganisation = new organisation_entity_1.Organisation();
|
|
54
60
|
unsavedOrganisation.name = `${auth0User.given_name ?? "My"} Organisation`;
|
|
55
61
|
// create roles
|
|
56
|
-
const ownerRole = new MembershipRole();
|
|
57
|
-
ownerRole.name = Roles.owner;
|
|
62
|
+
const ownerRole = new member_role_entity_1.MembershipRole();
|
|
63
|
+
ownerRole.name = RolesEnum_1.Roles.owner;
|
|
58
64
|
// create a new membership
|
|
59
|
-
const membership = new OrganisationMembership();
|
|
65
|
+
const membership = new organisation_membership_entity_1.OrganisationMembership();
|
|
60
66
|
membership.organisation = unsavedOrganisation;
|
|
61
67
|
membership.roles = [ownerRole];
|
|
62
68
|
if (foundPerson !== undefined && foundPerson !== null) {
|
|
@@ -114,7 +120,7 @@ let PersonService = class PersonService {
|
|
|
114
120
|
},
|
|
115
121
|
},
|
|
116
122
|
});
|
|
117
|
-
if (user.memberships.some((m) => m.roles.some((r) => r.name === Roles.owner))) {
|
|
123
|
+
if (user.memberships.some((m) => m.roles.some((r) => r.name === RolesEnum_1.Roles.owner))) {
|
|
118
124
|
throw new Error("Can't remove the owner of an organisation. Assign a new owner first.");
|
|
119
125
|
}
|
|
120
126
|
return this.repository.remove(user);
|
|
@@ -125,16 +131,16 @@ let PersonService = class PersonService {
|
|
|
125
131
|
currentUserUuid,
|
|
126
132
|
uuid,
|
|
127
133
|
});
|
|
128
|
-
throw new NotFoundException();
|
|
134
|
+
throw new common_1.NotFoundException();
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
137
|
};
|
|
132
138
|
PersonService = __decorate([
|
|
133
|
-
Injectable(),
|
|
134
|
-
__param(0, InjectRepository(Person)),
|
|
135
|
-
__metadata("design:paramtypes", [Repository,
|
|
136
|
-
|
|
137
|
-
AuthZClientService])
|
|
139
|
+
(0, common_1.Injectable)(),
|
|
140
|
+
__param(0, (0, typeorm_1.InjectRepository)(person_entity_1.Person)),
|
|
141
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
142
|
+
CoreLoggerService_1.default,
|
|
143
|
+
authz_service_1.AuthZClientService])
|
|
138
144
|
], PersonService);
|
|
139
|
-
|
|
145
|
+
exports.PersonService = PersonService;
|
|
140
146
|
//# 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,2CAA6D;AAC7D,6CAAiD;AACjD,qCAAmC;AAEnC,gEAAgE;AAEhE,oFAA4D;AAC5D,6DAAoD;AACpD,oFAA2E;AAC3E,4GAA+F;AAC/F,sFAA0E;AAE1E,4DAAgD;AAGzC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGV;IACA;IACA;IAJZ,YAEY,UAA8B,EAC9B,MAAyB,EACzB,WAA+B;QAF/B,eAAU,GAAV,UAAU,CAAoB;QAC9B,WAAM,GAAN,MAAM,CAAmB;QACzB,gBAAW,GAAX,WAAW,CAAoB;IACxC,CAAC;IAEJ,KAAK,CAAC,YAAY,CACd,OAAoB,EACpB,cAAsB;QAEtB,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,YAAY,CACd,OAAoB,EACpB,cAAsB;QA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B;QACZ,kCAAkB;GALlC,aAAa,CAqJzB;AArJY,sCAAa"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7,12 +8,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SwaggerGen = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
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");
|
|
16
22
|
/* istanbul ignore next */
|
|
17
23
|
let SwaggerGen = class SwaggerGen {
|
|
18
24
|
logger;
|
|
@@ -26,18 +32,18 @@ let SwaggerGen = class SwaggerGen {
|
|
|
26
32
|
this.logger.log("Skipping swagger model generation for this environment");
|
|
27
33
|
return;
|
|
28
34
|
}
|
|
29
|
-
const config = new DocumentBuilder()
|
|
35
|
+
const config = new swagger_1.DocumentBuilder()
|
|
30
36
|
.addBearerAuth()
|
|
31
37
|
.setTitle(this.config.appTitle)
|
|
32
38
|
.setDescription("Describes the backend api")
|
|
33
39
|
.build();
|
|
34
|
-
const document = SwaggerModule.createDocument(app, config);
|
|
35
|
-
SwaggerModule.setup("swagger", app, document);
|
|
40
|
+
const document = swagger_1.SwaggerModule.createDocument(app, config);
|
|
41
|
+
swagger_1.SwaggerModule.setup("swagger", app, document);
|
|
36
42
|
// tslint:disable-next-line: non-literal-fs-path
|
|
37
|
-
|
|
43
|
+
fs_1.default.writeFileSync(pathToSave, JSON.stringify(document, undefined, 2));
|
|
38
44
|
this.logger.log(`Wrote swagger api doc to ${pathToSave}`);
|
|
39
45
|
if (this.config.shouldAutomaticallyInstallApiModels) {
|
|
40
|
-
const modelGenerator = spawn("./node_modules/@darraghor/nest-backend-libs/dist/open-api-generation/generate.sh", {
|
|
46
|
+
const modelGenerator = (0, child_process_1.spawn)("./node_modules/@darraghor/nest-backend-libs/dist/open-api-generation/generate.sh", {
|
|
41
47
|
stdio: ["ignore", "ignore", "inherit"],
|
|
42
48
|
shell: true,
|
|
43
49
|
});
|
|
@@ -48,11 +54,11 @@ let SwaggerGen = class SwaggerGen {
|
|
|
48
54
|
}
|
|
49
55
|
};
|
|
50
56
|
SwaggerGen = __decorate([
|
|
51
|
-
Injectable()
|
|
57
|
+
(0, common_1.Injectable)()
|
|
52
58
|
// eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
|
|
53
59
|
,
|
|
54
|
-
__metadata("design:paramtypes", [
|
|
55
|
-
CoreConfigurationService])
|
|
60
|
+
__metadata("design:paramtypes", [CoreLoggerService_1.default,
|
|
61
|
+
CoreConfigurationService_1.CoreConfigurationService])
|
|
56
62
|
], SwaggerGen);
|
|
57
|
-
|
|
63
|
+
exports.SwaggerGen = SwaggerGen;
|
|
58
64
|
//# 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,2CAA4D;AAC5D,6CAA+D;AAC/D,4CAAoB;AAEpB,iDAAoC;AACpC,oFAA4D;AAC5D,sFAAiF;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,yBAAe,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,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC3D,uBAAa,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAE9C,gDAAgD;QAChD,YAAE,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,IAAA,qBAAK,EACxB,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,IAAA,mBAAU,GAAE;IACb,iFAAiF;;qCAGzD,2BAAiB;QACjB,mDAAwB;GAHnC,UAAU,CAsCtB;AAtCY,gCAAU"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -10,11 +11,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AppController = void 0;
|
|
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");
|
|
18
24
|
let AppController = class AppController {
|
|
19
25
|
appService;
|
|
20
26
|
logger;
|
|
@@ -33,27 +39,27 @@ let AppController = class AppController {
|
|
|
33
39
|
}
|
|
34
40
|
};
|
|
35
41
|
__decorate([
|
|
36
|
-
Get(),
|
|
37
|
-
ApiOkResponse({ type: String }),
|
|
42
|
+
(0, common_1.Get)(),
|
|
43
|
+
(0, swagger_1.ApiOkResponse)({ type: String }),
|
|
38
44
|
__metadata("design:type", Function),
|
|
39
45
|
__metadata("design:paramtypes", []),
|
|
40
46
|
__metadata("design:returntype", String)
|
|
41
47
|
], AppController.prototype, "getHello", null);
|
|
42
48
|
__decorate([
|
|
43
|
-
UseGuards(AuthGuard("jwt")),
|
|
44
|
-
ApiBearerAuth(),
|
|
45
|
-
Get("authorise"),
|
|
46
|
-
ApiOkResponse({ type: String }),
|
|
47
|
-
__param(0, Request()),
|
|
49
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
|
|
50
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
51
|
+
(0, common_1.Get)("authorise"),
|
|
52
|
+
(0, swagger_1.ApiOkResponse)({ type: String }),
|
|
53
|
+
__param(0, (0, common_1.Request)()),
|
|
48
54
|
__metadata("design:type", Function),
|
|
49
55
|
__metadata("design:paramtypes", [Object]),
|
|
50
56
|
__metadata("design:returntype", String)
|
|
51
57
|
], AppController.prototype, "getHelloAuthorized", null);
|
|
52
58
|
AppController = __decorate([
|
|
53
|
-
Controller(),
|
|
54
|
-
ApiTags("Application Support"),
|
|
55
|
-
__metadata("design:paramtypes", [AppService,
|
|
56
|
-
|
|
59
|
+
(0, common_1.Controller)(),
|
|
60
|
+
(0, swagger_1.ApiTags)("Application Support"),
|
|
61
|
+
__metadata("design:paramtypes", [app_service_1.AppService,
|
|
62
|
+
CoreLoggerService_1.default])
|
|
57
63
|
], AppController);
|
|
58
|
-
|
|
64
|
+
exports.AppController = AppController;
|
|
59
65
|
//# 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,2CAAmE;AACnE,+CAA2C;AAC3C,6CAAsE;AAEtE,oFAA4D;AAC5D,+CAAyC;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,IAAA,YAAG,GAAE;IACL,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;;;6CAG7B;AAED;IAAC,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAA,uBAAa,GAAE;IACf,IAAA,YAAG,EAAC,WAAW,CAAC;IAChB,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;IACV,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;uDAK5B;AArBQ,aAAa;IAFzB,IAAA,mBAAU,GAAE;IACZ,IAAA,iBAAO,EAAC,qBAAqB,CAAC;qCAGM,wBAAU;QACd,2BAAiB;GAHrC,aAAa,CAsBzB;AAtBY,sCAAa"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
5
|
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;
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AppService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
8
11
|
let AppService = class AppService {
|
|
9
12
|
getHello() {
|
|
10
13
|
return "Hello World!";
|
|
11
14
|
}
|
|
12
15
|
};
|
|
13
16
|
AppService = __decorate([
|
|
14
|
-
Injectable()
|
|
17
|
+
(0, common_1.Injectable)()
|
|
15
18
|
], AppService);
|
|
16
|
-
|
|
19
|
+
exports.AppService = AppService;
|
|
17
20
|
//# 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,2CAA0C;AAGnC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACnB,QAAQ;QACJ,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ,CAAA;AAJY,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB;AAJY,gCAAU"}
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
5
|
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;
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
};
|
|
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;
|
|
7
13
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
8
14
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
9
15
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
require("reflect-metadata");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const logger_module_1 = require("../logger/logger.module");
|
|
19
|
+
const app_controller_1 = require("./app.controller");
|
|
20
|
+
const app_service_1 = require("./app.service");
|
|
21
|
+
const SwaggerGen_1 = require("./SwaggerGen");
|
|
22
|
+
const core_1 = require("@nestjs/core");
|
|
23
|
+
const CoreLoggerService_1 = __importDefault(require("../logger/CoreLoggerService"));
|
|
24
|
+
const CoreConfigurationService_1 = require("../core-config/CoreConfigurationService");
|
|
25
|
+
const LoggingInterceptor_1 = require("../logger/LoggingInterceptor");
|
|
26
|
+
const CoreConfig_module_1 = require("../core-config/CoreConfig.module");
|
|
27
|
+
const config_1 = require("@nestjs/config");
|
|
22
28
|
let CoreModule = class CoreModule {
|
|
23
29
|
static initApplication(
|
|
24
30
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types,@typescript-eslint/no-explicit-any
|
|
@@ -27,22 +33,22 @@ let CoreModule = class CoreModule {
|
|
|
27
33
|
options) {
|
|
28
34
|
void (async () => {
|
|
29
35
|
try {
|
|
30
|
-
const app = await NestFactory.create(rootModule, {
|
|
36
|
+
const app = await core_1.NestFactory.create(rootModule, {
|
|
31
37
|
bodyParser: true,
|
|
32
38
|
});
|
|
33
|
-
const loggerService = app.get(
|
|
34
|
-
const configService = app.get(CoreConfigurationService);
|
|
39
|
+
const loggerService = app.get(CoreLoggerService_1.default);
|
|
40
|
+
const configService = app.get(CoreConfigurationService_1.CoreConfigurationService);
|
|
35
41
|
app.useLogger(loggerService);
|
|
36
42
|
app.enableCors({ origin: configService.frontEndAppUrl });
|
|
37
|
-
app.useGlobalPipes(new ValidationPipe({
|
|
43
|
+
app.useGlobalPipes(new common_1.ValidationPipe({
|
|
38
44
|
transform: true,
|
|
39
45
|
skipMissingProperties: false,
|
|
40
46
|
whitelist: true,
|
|
41
47
|
forbidNonWhitelisted: true,
|
|
42
48
|
forbidUnknownValues: true,
|
|
43
49
|
}));
|
|
44
|
-
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)), new LoggingInterceptor(loggerService));
|
|
45
|
-
const swaggerGen = app.get(SwaggerGen);
|
|
50
|
+
app.useGlobalInterceptors(new common_1.ClassSerializerInterceptor(app.get(core_1.Reflector)), new LoggingInterceptor_1.LoggingInterceptor(loggerService));
|
|
51
|
+
const swaggerGen = app.get(SwaggerGen_1.SwaggerGen);
|
|
46
52
|
swaggerGen.generate(app, "open-api/swagger.json");
|
|
47
53
|
loggerService.log(`will listen on port ${configService.webPort} (DEV: http://localhost:${configService.webPort} )`);
|
|
48
54
|
loggerService.log(`swagger will be available at (DEV: http://localhost:${configService.webPort}/swagger )`);
|
|
@@ -60,16 +66,16 @@ let CoreModule = class CoreModule {
|
|
|
60
66
|
}
|
|
61
67
|
};
|
|
62
68
|
CoreModule = __decorate([
|
|
63
|
-
Module({
|
|
69
|
+
(0, common_1.Module)({
|
|
64
70
|
imports: [
|
|
65
|
-
ConfigModule.forRoot({ cache: true }),
|
|
66
|
-
LoggerModule,
|
|
67
|
-
CoreConfigModule,
|
|
71
|
+
config_1.ConfigModule.forRoot({ cache: true }),
|
|
72
|
+
logger_module_1.LoggerModule,
|
|
73
|
+
CoreConfig_module_1.CoreConfigModule,
|
|
68
74
|
],
|
|
69
|
-
controllers: [AppController],
|
|
70
|
-
providers: [AppService, SwaggerGen],
|
|
71
|
-
exports: [SwaggerGen],
|
|
75
|
+
controllers: [app_controller_1.AppController],
|
|
76
|
+
providers: [app_service_1.AppService, SwaggerGen_1.SwaggerGen],
|
|
77
|
+
exports: [SwaggerGen_1.SwaggerGen],
|
|
72
78
|
})
|
|
73
79
|
], CoreModule);
|
|
74
|
-
|
|
80
|
+
exports.CoreModule = CoreModule;
|
|
75
81
|
//# 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,4BAA0B;AAC1B,2CAMwB;AACxB,2DAAqD;AACrD,qDAA+C;AAC/C,+CAAyC;AACzC,6CAAwC;AACxC,uCAAoD;AACpD,oFAA4D;AAC5D,sFAAiF;AACjF,qEAAgE;AAChE,wEAAkE;AAClE,2CAA4C;AAYrC,IAAM,UAAU,GAA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,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,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;YACnC,4BAAY;YACZ,oCAAgB;SACnB;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,EAAE,uBAAU,CAAC;QACnC,OAAO,EAAE,CAAC,uBAAU,CAAC;KACxB,CAAC;GACW,UAAU,CAsDtB;AAtDY,gCAAU"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7,24 +8,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NotFoundInterceptor = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const operators_1 = require("rxjs/operators");
|
|
12
15
|
let NotFoundInterceptor = class NotFoundInterceptor {
|
|
13
16
|
errorMessage;
|
|
14
17
|
constructor(errorMessage) {
|
|
15
18
|
this.errorMessage = errorMessage;
|
|
16
19
|
}
|
|
17
20
|
intercept(context, stream$) {
|
|
18
|
-
return stream$.handle().pipe(tap((data) => {
|
|
21
|
+
return stream$.handle().pipe((0, operators_1.tap)((data) => {
|
|
19
22
|
if (data === undefined) {
|
|
20
|
-
throw new NotFoundException(this.errorMessage);
|
|
23
|
+
throw new common_1.NotFoundException(this.errorMessage);
|
|
21
24
|
}
|
|
22
25
|
}));
|
|
23
26
|
}
|
|
24
27
|
};
|
|
25
28
|
NotFoundInterceptor = __decorate([
|
|
26
|
-
Injectable(),
|
|
29
|
+
(0, common_1.Injectable)(),
|
|
27
30
|
__metadata("design:paramtypes", [String])
|
|
28
31
|
], NotFoundInterceptor);
|
|
29
|
-
|
|
32
|
+
exports.NotFoundInterceptor = NotFoundInterceptor;
|
|
30
33
|
//# 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,2CAMwB;AAExB,8CAAmC;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,IAAA,eAAG,EAAC,CAAC,IAAI,EAAE,EAAE;YACT,IAAI,IAAI,KAAK,SAAS,EAAE;gBACpB,MAAM,IAAI,0BAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aAClD;QACL,CAAC,CAAC,CACL,CAAC;IACN,CAAC;CACJ,CAAA;AAfY,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;;GACA,mBAAmB,CAe/B;AAfY,kDAAmB"}
|