@darraghor/nest-backend-libs 2.0.0 → 2.2.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.
Files changed (44) hide show
  1. package/dist/database-postgres/write-typeorm-config.d.ts +1 -0
  2. package/dist/database-postgres/write-typeorm-config.js +1 -0
  3. package/dist/database-postgres/write-typeorm-config.js.map +1 -1
  4. package/dist/index.d.ts +4 -1
  5. package/dist/index.js +7 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/invitations/InvitationConfigurationService.d.ts +7 -0
  8. package/dist/invitations/InvitationConfigurationService.js +38 -0
  9. package/dist/invitations/InvitationConfigurationService.js.map +1 -0
  10. package/dist/invitations/InvitationConfigurationVariables.d.ts +6 -0
  11. package/dist/invitations/InvitationConfigurationVariables.js +7 -0
  12. package/dist/invitations/InvitationConfigurationVariables.js.map +1 -0
  13. package/dist/invitations/dto/create-invitation.dto.d.ts +5 -0
  14. package/dist/invitations/dto/create-invitation.dto.js +29 -0
  15. package/dist/invitations/dto/create-invitation.dto.js.map +1 -0
  16. package/dist/invitations/entities/invitation.entity.d.ts +14 -0
  17. package/dist/invitations/entities/invitation.entity.js +85 -0
  18. package/dist/invitations/entities/invitation.entity.js.map +1 -0
  19. package/dist/invitations/invitation.controller.d.ts +10 -0
  20. package/dist/invitations/invitation.controller.js +60 -0
  21. package/dist/invitations/invitation.controller.js.map +1 -0
  22. package/dist/invitations/invitation.module.d.ts +2 -0
  23. package/dist/invitations/invitation.module.js +41 -0
  24. package/dist/invitations/invitation.module.js.map +1 -0
  25. package/dist/invitations/invitation.service.d.ts +16 -0
  26. package/dist/invitations/invitation.service.js +92 -0
  27. package/dist/invitations/invitation.service.js.map +1 -0
  28. package/dist/organisation/entities/organisation.entity.d.ts +2 -0
  29. package/dist/organisation/entities/organisation.entity.js +9 -0
  30. package/dist/organisation/entities/organisation.entity.js.map +1 -1
  31. package/dist/root-app/core-app.module.js +2 -0
  32. package/dist/root-app/core-app.module.js.map +1 -1
  33. package/dist/smtp-email-client/EmailClientProvider.d.ts +1 -1
  34. package/dist/smtp-email-client/EmailClientProvider.js +3 -3
  35. package/dist/smtp-email-client/EmailClientProvider.js.map +1 -1
  36. package/dist/smtp-email-client/email-client.service.js +1 -1
  37. package/dist/smtp-email-client/email-client.service.js.map +1 -1
  38. package/dist/smtp-email-client/smtp-email-client.module.js +1 -1
  39. package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
  40. package/dist/stripe-client/stripe-account.module.js +2 -1
  41. package/dist/stripe-client/stripe-account.module.js.map +1 -1
  42. package/dist/stripe-client/stripe-controller.d.ts +1 -1
  43. package/dist/stripe-client/stripe-controller.js +8 -8
  44. package/package.json +5 -1
@@ -1 +1,2 @@
1
+ #!/usr/bin/env node
1
2
  export {};
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -1 +1 @@
1
- {"version":3,"file":"write-typeorm-config.js","sourceRoot":"","sources":["../../src/database-postgres/write-typeorm-config.ts"],"names":[],"mappings":";;;;;AAAA,yBAA0B;AAC1B,iGAA4F;AAC5F,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,EAAE,CAAC,aAAa,CACZ,gBAAgB;AAChB,sEAAsE;AACtE,IAAI,CAAC,SAAS,CACV,2EAAoC,CAAC,gBAAgB,EAAE,EACvD,SAAS,EACT,CAAC,CACJ,CACJ,CAAC"}
1
+ {"version":3,"file":"write-typeorm-config.js","sourceRoot":"","sources":["../../src/database-postgres/write-typeorm-config.ts"],"names":[],"mappings":";;;;;;AAEA,yBAA0B;AAC1B,iGAA4F;AAC5F,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,EAAE,CAAC,aAAa,CACZ,gBAAgB;AAChB,sEAAsE;AACtE,IAAI,CAAC,SAAS,CACV,2EAAoC,CAAC,gBAAgB,EAAE,EACvD,SAAS,EACT,CAAC,CACJ,CACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -25,4 +25,7 @@ import { CoreConfigModule } from "./core-config/CoreConfig.module";
25
25
  import { CliCommandService } from "./runningCommandLine/CliCommandService";
26
26
  import { ClaimsAuthorisationGuard } from "./authz/ClaimsAuthorisationGuard";
27
27
  import { MandatoryUserClaims } from "./authz/MandatoryUserClaims.decorator";
28
- export { CoreLoggerService, CoreConfigurationService, SmtpEmailClientModule, CoreModule, CoreConfigModule, SwaggerGen, DefaultAuthGuard, PostgresDatabaseModule as DatabaseModule, JwtStrategy, AuthzModule, Person, PostgresTypeOrmConfigurationProvider as TypeOrmConfigurationProvider, SmtpEmailClient, ValidatedConfigurationService, RequestWithUser, PersonModule, OrganisationModule, PersonService, SqliteDatabaseModule, SqliteDatabaseConfigurationService, TwitterClientService, TwitterAccountModule, EUploadMimeType, RunningCommandLineModule, CliCommandService, ClaimsAuthorisationGuard, MandatoryUserClaims, };
28
+ import { InvitationModule } from "./invitations/invitation.module";
29
+ import { StripeAccountModule } from "./stripe-client/stripe-account.module";
30
+ import { StripeEventHandler } from "./stripe-client/services/stripe-event-handler";
31
+ export { CoreLoggerService, CoreConfigurationService, SmtpEmailClientModule, CoreModule, CoreConfigModule, SwaggerGen, DefaultAuthGuard, PostgresDatabaseModule as DatabaseModule, JwtStrategy, AuthzModule, Person, PostgresTypeOrmConfigurationProvider as TypeOrmConfigurationProvider, SmtpEmailClient, ValidatedConfigurationService, RequestWithUser, PersonModule, OrganisationModule, PersonService, SqliteDatabaseModule, SqliteDatabaseConfigurationService, TwitterClientService, TwitterAccountModule, EUploadMimeType, RunningCommandLineModule, CliCommandService, ClaimsAuthorisationGuard, MandatoryUserClaims, InvitationModule, StripeAccountModule, StripeEventHandler, };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MandatoryUserClaims = exports.ClaimsAuthorisationGuard = exports.CliCommandService = exports.RunningCommandLineModule = exports.EUploadMimeType = exports.TwitterAccountModule = exports.TwitterClientService = exports.SqliteDatabaseConfigurationService = exports.SqliteDatabaseModule = exports.PersonService = exports.OrganisationModule = exports.PersonModule = exports.ValidatedConfigurationService = exports.SmtpEmailClient = exports.TypeOrmConfigurationProvider = exports.Person = exports.AuthzModule = exports.JwtStrategy = exports.DatabaseModule = exports.DefaultAuthGuard = exports.SwaggerGen = exports.CoreConfigModule = exports.CoreModule = exports.SmtpEmailClientModule = exports.CoreConfigurationService = exports.CoreLoggerService = void 0;
6
+ exports.StripeEventHandler = exports.StripeAccountModule = exports.InvitationModule = exports.MandatoryUserClaims = exports.ClaimsAuthorisationGuard = exports.CliCommandService = exports.RunningCommandLineModule = exports.EUploadMimeType = exports.TwitterAccountModule = exports.TwitterClientService = exports.SqliteDatabaseConfigurationService = exports.SqliteDatabaseModule = exports.PersonService = exports.OrganisationModule = exports.PersonModule = exports.ValidatedConfigurationService = exports.SmtpEmailClient = exports.TypeOrmConfigurationProvider = exports.Person = exports.AuthzModule = exports.JwtStrategy = exports.DatabaseModule = exports.DefaultAuthGuard = exports.SwaggerGen = exports.CoreConfigModule = exports.CoreModule = exports.SmtpEmailClientModule = exports.CoreConfigurationService = exports.CoreLoggerService = void 0;
7
7
  /* eslint-disable unicorn/prefer-export-from */
8
8
  const RunningCommandLine_module_1 = require("./runningCommandLine/RunningCommandLine.module");
9
9
  Object.defineProperty(exports, "RunningCommandLineModule", { enumerable: true, get: function () { return RunningCommandLine_module_1.RunningCommandLineModule; } });
@@ -57,4 +57,10 @@ const ClaimsAuthorisationGuard_1 = require("./authz/ClaimsAuthorisationGuard");
57
57
  Object.defineProperty(exports, "ClaimsAuthorisationGuard", { enumerable: true, get: function () { return ClaimsAuthorisationGuard_1.ClaimsAuthorisationGuard; } });
58
58
  const MandatoryUserClaims_decorator_1 = require("./authz/MandatoryUserClaims.decorator");
59
59
  Object.defineProperty(exports, "MandatoryUserClaims", { enumerable: true, get: function () { return MandatoryUserClaims_decorator_1.MandatoryUserClaims; } });
60
+ const invitation_module_1 = require("./invitations/invitation.module");
61
+ Object.defineProperty(exports, "InvitationModule", { enumerable: true, get: function () { return invitation_module_1.InvitationModule; } });
62
+ const stripe_account_module_1 = require("./stripe-client/stripe-account.module");
63
+ Object.defineProperty(exports, "StripeAccountModule", { enumerable: true, get: function () { return stripe_account_module_1.StripeAccountModule; } });
64
+ const stripe_event_handler_1 = require("./stripe-client/services/stripe-event-handler");
65
+ Object.defineProperty(exports, "StripeEventHandler", { enumerable: true, get: function () { return stripe_event_handler_1.StripeEventHandler; } });
60
66
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAA+C;AAC/C,8FAAwF;AAoDpF,yGApDI,oDAAwB,OAoDJ;AAnD5B,oFAA6E;AAiDzE,qGAjDI,6CAAoB,OAiDJ;AAhDxB,2FAAmF;AA6B/E,sGA7BI,gDAAqB,OA6BJ;AA5BzB,mDAA+C;AAgD3C,gGAhDI,gCAAe,OAgDJ;AA/CnB,uDAAiD;AAkC7C,4FAlCI,0BAAW,OAkCJ;AAjCf,yDAAkD;AAgC9C,4FAhCI,2BAAW,OAgCJ;AA/Bf,+DAA0D;AA6BtD,iGA7BI,mCAAgB,OA6BJ;AA3BpB,iGAA4F;AAkCxF,8GAlCI,6DAA6B,OAkCJ;AAjCjC,qFAAgF;AAqB5E,yGArBI,mDAAwB,OAqBJ;AApB5B,yFAAmF;AA0BrD,+FA1BtB,gDAAsB,OA0Bc;AAzB5C,mHAA8G;AA6BlE,6GA7BpC,2EAAoC,OA6B4B;AA5BxE,mFAA6E;AAmCzE,qGAnCI,4CAAoB,OAmCJ;AAlCxB,6GAAwG;AAmC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5B5C,mHAA8G;AAgClE,6GAhCpC,2EAAoC,OAgC4B;AA/BxE,mFAA6E;AAsCzE,qGAtCI,4CAAoB,OAsCJ;AArCxB,6GAAwG;AAsCpG,mHAtCI,uEAAkC,OAsCJ;AArCtC,mFAAyE;AA8BrE,gGA9BI,sCAAe,OA8BJ;AA7BnB,mFAA2D;AAiBvD,4BAjBG,2BAAiB,CAiBH;AAhBrB,4EAAsE;AAgClE,mGAhCI,wCAAkB,OAgCJ;AA/BtB,mEAAuD;AAyBnD,uFAzBI,sBAAM,OAyBJ;AAxBV,0DAAoD;AA6BhD,6FA7BI,4BAAY,OA6BJ;AA5BhB,4DAAsD;AA8BlD,8FA9BI,8BAAa,OA8BJ;AA7BjB,gEAAsD;AAelD,2FAfI,4BAAU,OAeJ;AAdd,sDAAiD;AAgB7C,2FAhBI,uBAAU,OAgBJ;AAfd,6FAAsF;AA8BlF,qGA9BI,6CAAoB,OA8BJ;AA7BxB,uEAAiE;AAa7D,iGAbI,oCAAgB,OAaJ;AAZpB,8EAAyE;AAgCrE,kGAhCI,qCAAiB,OAgCJ;AA/BrB,+EAA0E;AAgCtE,yGAhCI,mDAAwB,OAgCJ;AA/B5B,yFAA0E;AAgCtE,oGAhCI,mDAAmB,OAgCJ;AA/BvB,uEAAiE;AAgC7D,iGAhCI,oCAAgB,OAgCJ;AA/BpB,iFAA0E;AAgCtE,oGAhCI,2CAAmB,OAgCJ;AA/BvB,wFAAiF;AAgC7E,mGAhCI,yCAAkB,OAgCJ"}
@@ -0,0 +1,7 @@
1
+ import { ConfigService } from "@nestjs/config";
2
+ import { ValidatedConfigurationService } from "../configuration/ValidatedConfigurationService";
3
+ export declare class InvitationsConfigurationService extends ValidatedConfigurationService {
4
+ private configService;
5
+ constructor(configService: ConfigService);
6
+ get baseUrl(): string;
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InvitationsConfigurationService = void 0;
13
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
14
+ const common_1 = require("@nestjs/common");
15
+ const config_1 = require("@nestjs/config");
16
+ const class_validator_1 = require("class-validator");
17
+ const ValidatedConfigurationService_1 = require("../configuration/ValidatedConfigurationService");
18
+ let InvitationsConfigurationService = class InvitationsConfigurationService extends ValidatedConfigurationService_1.ValidatedConfigurationService {
19
+ constructor(configService) {
20
+ super();
21
+ this.configService = configService;
22
+ }
23
+ get baseUrl() {
24
+ return this.configService.get("invitations.baseUrl");
25
+ }
26
+ };
27
+ __decorate([
28
+ (0, class_validator_1.IsDefined)(),
29
+ (0, class_validator_1.IsString)(),
30
+ __metadata("design:type", String),
31
+ __metadata("design:paramtypes", [])
32
+ ], InvitationsConfigurationService.prototype, "baseUrl", null);
33
+ InvitationsConfigurationService = __decorate([
34
+ (0, common_1.Injectable)(),
35
+ __metadata("design:paramtypes", [config_1.ConfigService])
36
+ ], InvitationsConfigurationService);
37
+ exports.InvitationsConfigurationService = InvitationsConfigurationService;
38
+ //# sourceMappingURL=InvitationConfigurationService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvitationConfigurationService.js","sourceRoot":"","sources":["../../src/invitations/InvitationConfigurationService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA6D;AAC7D,2CAA0C;AAC1C,2CAA6C;AAC7C,qDAAoD;AACpD,kGAA6F;AAGtF,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,6DAA6B;IAC9E,YAAoB,aAA4B;QAC5C,KAAK,EAAE,CAAC;QADQ,kBAAa,GAAb,aAAa,CAAe;IAEhD,CAAC;IAED,IAEI,OAAO;QACP,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,qBAAqB,CAAE,CAAC;IAClE,CAAC;CACJ,CAAA;AALG;IAAC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;8DAGV;AATQ,+BAA+B;IAD3C,IAAA,mBAAU,GAAE;qCAE0B,sBAAa;GADvC,+BAA+B,CAU3C;AAVY,0EAA+B"}
@@ -0,0 +1,6 @@
1
+ declare const _default: (() => {
2
+ baseUrl: string | undefined;
3
+ }) & import("@nestjs/config").ConfigFactoryKeyHost<{
4
+ baseUrl: string | undefined;
5
+ }>;
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("@nestjs/config");
4
+ exports.default = (0, config_1.registerAs)("invitations", () => ({
5
+ baseUrl: process.env.INVITATION_URLS_BASE_URL,
6
+ }));
7
+ //# sourceMappingURL=InvitationConfigurationVariables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvitationConfigurationVariables.js","sourceRoot":"","sources":["../../src/invitations/InvitationConfigurationVariables.ts"],"names":[],"mappings":";;AAAA,2CAA0C;AAE1C,kBAAe,IAAA,mBAAU,EAAC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB;CAChD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare class CreateInvitationDto {
2
+ givenName: string;
3
+ emailAddress: string;
4
+ organisationId: number;
5
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateInvitationDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ class CreateInvitationDto {
15
+ }
16
+ __decorate([
17
+ (0, swagger_1.ApiProperty)(),
18
+ __metadata("design:type", String)
19
+ ], CreateInvitationDto.prototype, "givenName", void 0);
20
+ __decorate([
21
+ (0, swagger_1.ApiProperty)(),
22
+ __metadata("design:type", String)
23
+ ], CreateInvitationDto.prototype, "emailAddress", void 0);
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)(),
26
+ __metadata("design:type", Number)
27
+ ], CreateInvitationDto.prototype, "organisationId", void 0);
28
+ exports.CreateInvitationDto = CreateInvitationDto;
29
+ //# sourceMappingURL=create-invitation.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-invitation.dto.js","sourceRoot":"","sources":["../../../src/invitations/dto/create-invitation.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,MAAa,mBAAmB;CAS/B;AARG;IAAC,IAAA,qBAAW,GAAE;;sDACK;AAEnB;IAAC,IAAA,qBAAW,GAAE;;yDACQ;AAEtB;IAAC,IAAA,qBAAW,GAAE;;2DACU;AAR5B,kDASC"}
@@ -0,0 +1,14 @@
1
+ import { Organisation } from "../../organisation/entities/organisation.entity";
2
+ export declare class Invitation {
3
+ id: number;
4
+ uuid: string;
5
+ givenName: string;
6
+ emailAddress: string;
7
+ notificationSent: Date;
8
+ expiresOn: Date;
9
+ acceptedOn?: Date;
10
+ organisation: Organisation;
11
+ createdDate: Date;
12
+ updateDate: Date;
13
+ deletedDate?: Date;
14
+ }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Invitation = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const typeorm_1 = require("typeorm");
15
+ const organisation_entity_1 = require("../../organisation/entities/organisation.entity");
16
+ let Invitation = class Invitation {
17
+ };
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
20
+ (0, swagger_1.ApiProperty)(),
21
+ __metadata("design:type", Number)
22
+ ], Invitation.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.Column)("uuid", {
25
+ name: "uuid",
26
+ default: () => "uuid_generate_v4()",
27
+ }),
28
+ (0, typeorm_1.Generated)("uuid"),
29
+ (0, swagger_1.ApiProperty)(),
30
+ __metadata("design:type", String)
31
+ ], Invitation.prototype, "uuid", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)(),
34
+ (0, swagger_1.ApiProperty)(),
35
+ __metadata("design:type", String)
36
+ ], Invitation.prototype, "givenName", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)(),
39
+ (0, swagger_1.ApiProperty)(),
40
+ __metadata("design:type", String)
41
+ ], Invitation.prototype, "emailAddress", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)(),
44
+ (0, swagger_1.ApiProperty)(),
45
+ __metadata("design:type", Date)
46
+ ], Invitation.prototype, "notificationSent", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)(),
49
+ (0, swagger_1.ApiProperty)(),
50
+ __metadata("design:type", Date)
51
+ ], Invitation.prototype, "expiresOn", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)(),
54
+ (0, swagger_1.ApiPropertyOptional)(),
55
+ __metadata("design:type", Date)
56
+ ], Invitation.prototype, "acceptedOn", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)(),
59
+ (0, swagger_1.ApiProperty)(),
60
+ (0, typeorm_1.ManyToOne)(() => organisation_entity_1.Organisation, (org) => org.invitations, {
61
+ eager: true,
62
+ cascade: ["insert", "update"],
63
+ }),
64
+ __metadata("design:type", organisation_entity_1.Organisation)
65
+ ], Invitation.prototype, "organisation", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.CreateDateColumn)(),
68
+ (0, swagger_1.ApiProperty)(),
69
+ __metadata("design:type", Date)
70
+ ], Invitation.prototype, "createdDate", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.UpdateDateColumn)(),
73
+ (0, swagger_1.ApiProperty)(),
74
+ __metadata("design:type", Date)
75
+ ], Invitation.prototype, "updateDate", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.DeleteDateColumn)(),
78
+ (0, swagger_1.ApiPropertyOptional)(),
79
+ __metadata("design:type", Date)
80
+ ], Invitation.prototype, "deletedDate", void 0);
81
+ Invitation = __decorate([
82
+ (0, typeorm_1.Entity)()
83
+ ], Invitation);
84
+ exports.Invitation = Invitation;
85
+ //# sourceMappingURL=invitation.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation.entity.js","sourceRoot":"","sources":["../../../src/invitations/entities/invitation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AAEjE,qCASiB;AACjB,yFAA6E;AAGtE,IAAM,UAAU,GAAhB,MAAM,UAAU;CAoDtB,CAAA;AAnDG;IAAC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;sCACF;AAEZ;IAAC,IAAA,gBAAM,EAAC,MAAM,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB;KACtC,CAAC;IACD,IAAA,mBAAS,EAAC,MAAM,CAAC;IACjB,IAAA,qBAAW,GAAE;;wCACO;AAErB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;6CACK;AAEnB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;gDACQ;AAEtB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;8BACK,IAAI;oDAAC;AAExB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;8BACF,IAAI;6CAAC;AAEjB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,6BAAmB,GAAE;8BACT,IAAI;8CAAC;AAElB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;IACb,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE;QACrD,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAChC,CAAC;8BACa,kCAAY;gDAAC;AAE5B;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;+CAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;8CAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,6BAAmB,GAAE;8BACR,IAAI;+CAAC;AAnDV,UAAU;IADtB,IAAA,gBAAM,GAAE;GACI,UAAU,CAoDtB;AApDY,gCAAU"}
@@ -0,0 +1,10 @@
1
+ import { RequestWithUser } from "../authz/RequestWithUser";
2
+ import { Invitation } from "./entities/invitation.entity";
3
+ import { InvitationService } from "./invitation.service";
4
+ import { CreateInvitationDto } from "./dto/create-invitation.dto";
5
+ export declare class InvitationController {
6
+ private readonly invitationService;
7
+ constructor(invitationService: InvitationService);
8
+ create(createDto: CreateInvitationDto, request: RequestWithUser): Promise<Invitation>;
9
+ remove(uuid: string, request: RequestWithUser): Promise<boolean>;
10
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.InvitationController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const passport_1 = require("@nestjs/passport");
19
+ const invitation_entity_1 = require("./entities/invitation.entity");
20
+ const invitation_service_1 = require("./invitation.service");
21
+ const create_invitation_dto_1 = require("./dto/create-invitation.dto");
22
+ let InvitationController = class InvitationController {
23
+ constructor(invitationService) {
24
+ this.invitationService = invitationService;
25
+ }
26
+ async create(createDto, request) {
27
+ return this.invitationService.create(createDto, request.user);
28
+ }
29
+ async remove(uuid, request) {
30
+ const deleteResult = await this.invitationService.remove(uuid, request.user.id);
31
+ return deleteResult.deletedDate !== undefined;
32
+ }
33
+ };
34
+ __decorate([
35
+ (0, common_1.Post)(),
36
+ (0, swagger_1.ApiOkResponse)({ type: invitation_entity_1.Invitation }),
37
+ __param(0, (0, common_1.Body)()),
38
+ __param(1, (0, common_1.Request)()),
39
+ __metadata("design:type", Function),
40
+ __metadata("design:paramtypes", [create_invitation_dto_1.CreateInvitationDto, Object]),
41
+ __metadata("design:returntype", Promise)
42
+ ], InvitationController.prototype, "create", null);
43
+ __decorate([
44
+ (0, common_1.Delete)(":uuid"),
45
+ (0, swagger_1.ApiOkResponse)({ type: invitation_entity_1.Invitation }),
46
+ __param(0, (0, common_1.Param)("uuid")),
47
+ __param(1, (0, common_1.Request)()),
48
+ __metadata("design:type", Function),
49
+ __metadata("design:paramtypes", [String, Object]),
50
+ __metadata("design:returntype", Promise)
51
+ ], InvitationController.prototype, "remove", null);
52
+ InvitationController = __decorate([
53
+ (0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
54
+ (0, swagger_1.ApiBearerAuth)(),
55
+ (0, common_1.Controller)("invitations"),
56
+ (0, swagger_1.ApiTags)("organisations"),
57
+ __metadata("design:paramtypes", [invitation_service_1.InvitationService])
58
+ ], InvitationController);
59
+ exports.InvitationController = InvitationController;
60
+ //# sourceMappingURL=invitation.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation.controller.js","sourceRoot":"","sources":["../../src/invitations/invitation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AAExB,6CAAsE;AAEtE,+CAA2C;AAE3C,oEAAwD;AACxD,6DAAuD;AACvD,uEAAgE;AAMzD,IAAM,oBAAoB,GAA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) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
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.InvitationModule = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const logger_module_1 = require("../logger/logger.module");
15
+ const typeorm_1 = require("@nestjs/typeorm");
16
+ const invitation_entity_1 = require("./entities/invitation.entity");
17
+ const invitation_controller_1 = require("./invitation.controller");
18
+ const invitation_service_1 = require("./invitation.service");
19
+ const smtp_email_client_module_1 = require("../smtp-email-client/smtp-email-client.module");
20
+ const organisation_module_1 = require("../organisation/organisation.module");
21
+ const config_1 = require("@nestjs/config");
22
+ const InvitationConfigurationVariables_1 = __importDefault(require("./InvitationConfigurationVariables"));
23
+ const InvitationConfigurationService_1 = require("./InvitationConfigurationService");
24
+ let InvitationModule = class InvitationModule {
25
+ };
26
+ InvitationModule = __decorate([
27
+ (0, common_1.Module)({
28
+ imports: [
29
+ config_1.ConfigModule.forFeature(InvitationConfigurationVariables_1.default),
30
+ logger_module_1.LoggerModule,
31
+ typeorm_1.TypeOrmModule.forFeature([invitation_entity_1.Invitation]),
32
+ smtp_email_client_module_1.SmtpEmailClientModule,
33
+ organisation_module_1.OrganisationModule,
34
+ ],
35
+ controllers: [invitation_controller_1.InvitationController],
36
+ providers: [invitation_service_1.InvitationService, InvitationConfigurationService_1.InvitationsConfigurationService],
37
+ exports: [invitation_service_1.InvitationService],
38
+ })
39
+ ], InvitationModule);
40
+ exports.InvitationModule = InvitationModule;
41
+ //# sourceMappingURL=invitation.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation.module.js","sourceRoot":"","sources":["../../src/invitations/invitation.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAsC;AACtC,2DAAqD;AACrD,6CAA8C;AAC9C,oEAAwD;AACxD,mEAA6D;AAC7D,6DAAuD;AACvD,4FAAoF;AACpF,6EAAuE;AACvE,2CAA4C;AAC5C,0GAAiE;AACjE,qFAAiF;AAc1E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,gBAAgB;IAZ5B,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,UAAU,CAAC,0CAAe,CAAC;YACxC,4BAAY;YACZ,uBAAa,CAAC,UAAU,CAAC,CAAC,8BAAU,CAAC,CAAC;YACtC,gDAAqB;YACrB,wCAAkB;SACrB;QACD,WAAW,EAAE,CAAC,4CAAoB,CAAC;QACnC,SAAS,EAAE,CAAC,sCAAiB,EAAE,gEAA+B,CAAC;QAC/D,OAAO,EAAE,CAAC,sCAAiB,CAAC;KAC/B,CAAC;GACW,gBAAgB,CAAG;AAAnB,4CAAgB"}
@@ -0,0 +1,16 @@
1
+ import { Repository } from "typeorm";
2
+ import { CreateInvitationDto } from "./dto/create-invitation.dto";
3
+ import { Invitation } from "./entities/invitation.entity";
4
+ import { SmtpEmailClient } from "../smtp-email-client/email-client.service";
5
+ import { Person } from "../person/entities/person.entity";
6
+ import { Organisation } from "../organisation/entities/organisation.entity";
7
+ import { InvitationsConfigurationService } from "./InvitationConfigurationService";
8
+ export declare class InvitationService {
9
+ private invitationRepository;
10
+ private organisationRepository;
11
+ private readonly emailClient;
12
+ private readonly configService;
13
+ constructor(invitationRepository: Repository<Invitation>, organisationRepository: Repository<Organisation>, emailClient: SmtpEmailClient, configService: InvitationsConfigurationService);
14
+ create(createDto: CreateInvitationDto, createdBy: Omit<Person, "nullChecks">): Promise<Invitation>;
15
+ remove(uuid: string, currentUserId: number): Promise<Invitation>;
16
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.InvitationService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const RolesEnum_1 = require("../organisation/dto/RolesEnum");
20
+ const invitation_entity_1 = require("./entities/invitation.entity");
21
+ const email_client_service_1 = require("../smtp-email-client/email-client.service");
22
+ const organisation_entity_1 = require("../organisation/entities/organisation.entity");
23
+ const InvitationConfigurationService_1 = require("./InvitationConfigurationService");
24
+ let InvitationService = class InvitationService {
25
+ constructor(invitationRepository, organisationRepository, emailClient, configService) {
26
+ this.invitationRepository = invitationRepository;
27
+ this.organisationRepository = organisationRepository;
28
+ this.emailClient = emailClient;
29
+ this.configService = configService;
30
+ }
31
+ async create(createDto, createdBy) {
32
+ const existingInvitations = await this.invitationRepository.find({
33
+ where: {
34
+ emailAddress: createDto.emailAddress,
35
+ organisation: {
36
+ id: createDto.organisationId,
37
+ },
38
+ },
39
+ });
40
+ const hasUnexpiredInvitations = existingInvitations.some((invitation) => invitation.expiresOn > new Date());
41
+ if (hasUnexpiredInvitations) {
42
+ throw new Error("An valid invitation already exists for this email address for this organisation");
43
+ }
44
+ // otherwise, create a new invitation
45
+ const unsavedInvitation = new invitation_entity_1.Invitation();
46
+ unsavedInvitation.emailAddress = createDto.emailAddress;
47
+ unsavedInvitation.expiresOn = new Date();
48
+ unsavedInvitation.expiresOn.setDate(unsavedInvitation.expiresOn.getDate() + 1);
49
+ unsavedInvitation.organisation =
50
+ await this.organisationRepository.findOneOrFail({
51
+ where: { id: createDto.organisationId },
52
+ });
53
+ unsavedInvitation.givenName = createDto.givenName;
54
+ const savedInvitation = await this.invitationRepository.save(unsavedInvitation);
55
+ // try to email the invitation
56
+ await this.emailClient.sendMail([unsavedInvitation.emailAddress], [], `Invitation to join ${unsavedInvitation.organisation.name}`, createdBy.uuid, `You have been invited to join ${unsavedInvitation.organisation.name} by ${createdBy.givenName || "another "} ${createdBy.familyName || "member"}. Please click the link below to accept the invitation.
57
+
58
+ ${this.configService.baseUrl}/accept-invitation/${savedInvitation.uuid}`);
59
+ // if it gets to here we have a sent invitation
60
+ savedInvitation.notificationSent = new Date();
61
+ return this.invitationRepository.save(savedInvitation);
62
+ }
63
+ async remove(uuid, currentUserId) {
64
+ const invitation = await this.invitationRepository.findOneOrFail({
65
+ where: {
66
+ uuid,
67
+ organisation: {
68
+ memberships: {
69
+ person: {
70
+ id: currentUserId,
71
+ },
72
+ roles: {
73
+ name: RolesEnum_1.Roles.owner,
74
+ },
75
+ },
76
+ },
77
+ },
78
+ });
79
+ return this.invitationRepository.remove(invitation);
80
+ }
81
+ };
82
+ InvitationService = __decorate([
83
+ (0, common_1.Injectable)(),
84
+ __param(0, (0, typeorm_1.InjectRepository)(invitation_entity_1.Invitation)),
85
+ __param(1, (0, typeorm_1.InjectRepository)(organisation_entity_1.Organisation)),
86
+ __metadata("design:paramtypes", [typeorm_2.Repository,
87
+ typeorm_2.Repository,
88
+ email_client_service_1.SmtpEmailClient,
89
+ InvitationConfigurationService_1.InvitationsConfigurationService])
90
+ ], InvitationService);
91
+ exports.InvitationService = InvitationService;
92
+ //# sourceMappingURL=invitation.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation.service.js","sourceRoot":"","sources":["../../src/invitations/invitation.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0C;AAC1C,6CAAiD;AACjD,qCAAmC;AACnC,6DAAoD;AAEpD,oEAAwD;AACxD,oFAA0E;AAE1E,sFAA0E;AAC1E,qFAAiF;AAG1E,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC1B,YAEY,oBAA4C,EAE5C,sBAAgD,EACvC,WAA4B,EAC5B,aAA8C;QAJvD,yBAAoB,GAApB,oBAAoB,CAAwB;QAE5C,2BAAsB,GAAtB,sBAAsB,CAA0B;QACvC,gBAAW,GAAX,WAAW,CAAiB;QAC5B,kBAAa,GAAb,aAAa,CAAiC;IAChE,CAAC;IAEJ,KAAK,CAAC,MAAM,CACR,SAA8B,EAC9B,SAAqC;QAErC,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAC7D,KAAK,EAAE;gBACH,YAAY,EAAE,SAAS,CAAC,YAAY;gBACpC,YAAY,EAAE;oBACV,EAAE,EAAE,SAAS,CAAC,cAAc;iBAC/B;aACJ;SACJ,CAAC,CAAC;QAEH,MAAM,uBAAuB,GAAG,mBAAmB,CAAC,IAAI,CACpD,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CACpD,CAAC;QACF,IAAI,uBAAuB,EAAE;YACzB,MAAM,IAAI,KAAK,CACX,iFAAiF,CACpF,CAAC;SACL;QAED,qCAAqC;QACrC,MAAM,iBAAiB,GAAG,IAAI,8BAAU,EAAE,CAAC;QAC3C,iBAAiB,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;QACx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;yBACpB;wBACD,KAAK,EAAE;4BACH,IAAI,EAAE,iBAAK,CAAC,KAAK;yBACpB;qBACJ;iBACJ;aACJ;SACJ,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;CACJ,CAAA;AA3FY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAGJ,WAAA,IAAA,0BAAgB,EAAC,8BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,kCAAY,CAAC,CAAA;qCADD,oBAAU;QAER,oBAAU;QACZ,sCAAe;QACb,gEAA+B;GAP1D,iBAAiB,CA2F7B;AA3FY,8CAAiB"}
@@ -1,8 +1,10 @@
1
+ import { Invitation } from "../../invitations/entities/invitation.entity";
1
2
  import { OrganisationMembership } from "./organisation-membership.entity";
2
3
  export declare class Organisation {
3
4
  id: number;
4
5
  uuid: string;
5
6
  memberships: OrganisationMembership[];
7
+ invitations: Invitation[];
6
8
  name: string;
7
9
  createdDate: Date;
8
10
  updateDate: Date;
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Organisation = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const typeorm_1 = require("typeorm");
15
+ const invitation_entity_1 = require("../../invitations/entities/invitation.entity");
15
16
  const organisation_membership_entity_1 = require("./organisation-membership.entity");
16
17
  let Organisation = class Organisation {
17
18
  // eslint-disable-next-line @typescript-eslint/require-await
@@ -43,6 +44,14 @@ __decorate([
43
44
  (0, typeorm_1.Index)(),
44
45
  __metadata("design:type", Array)
45
46
  ], Organisation.prototype, "memberships", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.OneToMany)(() => invitation_entity_1.Invitation, (om) => om.organisation, {
49
+ eager: true,
50
+ cascade: ["insert", "update"],
51
+ }),
52
+ (0, typeorm_1.Index)(),
53
+ __metadata("design:type", Array)
54
+ ], Organisation.prototype, "invitations", void 0);
46
55
  __decorate([
47
56
  (0, typeorm_1.Column)(),
48
57
  (0, swagger_1.ApiProperty)(),
@@ -1 +1 @@
1
- {"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCAaiB;AACjB,qFAAwE;AAGjE,IAAM,YAAY,GAAlB,MAAM,YAAY;IAoCrB,4DAA4D;IAItD,AAAN,KAAK,CAAC,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;SACzB;IACL,CAAC;CACJ,CAAA;AA5CG;IAAC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;wCACF;AAEZ;IAAC,IAAA,gBAAM,EAAC,MAAM,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB;KACtC,CAAC;IACD,IAAA,mBAAS,EAAC,MAAM,CAAC;IACjB,IAAA,qBAAW,GAAE;;0CACO;AAErB;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uDAAsB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE;QAC9D,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAChC,CAAC;IACD,IAAA,eAAK,GAAE;;iDAC+B;AAEvC;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;0CACA;AAEd;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;iDAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;gDAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;iDAAC;AAMb;IAHL,IAAA,mBAAS,GAAE;IACX,IAAA,qBAAW,GAAE;IACb,IAAA,qBAAW,GAAE;;;;8CAKb;AA5CQ,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CA6CxB;AA7CY,oCAAY"}
1
+ {"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCAaiB;AACjB,oFAAwE;AACxE,qFAAwE;AAGjE,IAAM,YAAY,GAAlB,MAAM,YAAY;IA2CrB,4DAA4D;IAItD,AAAN,KAAK,CAAC,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;SACzB;IACL,CAAC;CACJ,CAAA;AAnDG;IAAC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;wCACF;AAEZ;IAAC,IAAA,gBAAM,EAAC,MAAM,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB;KACtC,CAAC;IACD,IAAA,mBAAS,EAAC,MAAM,CAAC;IACjB,IAAA,qBAAW,GAAE;;0CACO;AAErB;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uDAAsB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE;QAC9D,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAChC,CAAC;IACD,IAAA,eAAK,GAAE;;iDAC+B;AAEvC;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAU,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE;QAClD,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAChC,CAAC;IACD,IAAA,eAAK,GAAE;;iDACmB;AAE3B;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;0CACA;AAEd;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;iDAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;gDAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;iDAAC;AAMb;IAHL,IAAA,mBAAS,GAAE;IACX,IAAA,qBAAW,GAAE;IACb,IAAA,qBAAW,GAAE;;;;8CAKb;AAnDQ,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAoDxB;AApDY,oCAAY"}
@@ -48,6 +48,8 @@ let CoreModule = class CoreModule {
48
48
  forbidUnknownValues: true,
49
49
  }));
50
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);
52
+ swaggerGen.generate(app, "open-api/swagger.json");
51
53
  loggerService.log(`will listen on port ${configService.webPort} (DEV: http://localhost:${configService.webPort} )`);
52
54
  loggerService.log(`swagger will be available at (DEV: http://localhost:${configService.webPort}/swagger )`);
53
55
  await callback(app);
@@ -1 +1 @@
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,GAAhB,MAAM,UAAU;IACZ,MAAM,CAAC,eAAe;IACzB,gHAAgH;IA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,CAAC,wBAAU,EAAE,uBAAU,CAAC;QACnC,OAAO,EAAE,CAAC,uBAAU,CAAC;KACxB,CAAC;GACW,UAAU,CAsDtB;AAtDY,gCAAU"}
@@ -1,6 +1,6 @@
1
1
  import { Transporter } from "nodemailer";
2
2
  import { EmailConfigurationService } from "./EmailConfigurationService";
3
- export declare const EmailClientProvider: {
3
+ export declare const EmailTransporterProvider: {
4
4
  provide: string;
5
5
  useFactory: (config: EmailConfigurationService) => Transporter;
6
6
  inject: (typeof EmailConfigurationService)[];
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmailClientProvider = void 0;
3
+ exports.EmailTransporterProvider = void 0;
4
4
  const nodemailer_1 = require("nodemailer");
5
5
  const EmailConfigurationService_1 = require("./EmailConfigurationService");
6
- exports.EmailClientProvider = {
7
- provide: "SmtpEmailClient",
6
+ exports.EmailTransporterProvider = {
7
+ provide: "SmtpEmailTransporter",
8
8
  useFactory: (config) => {
9
9
  return (0, nodemailer_1.createTransport)({
10
10
  host: config.smtpHost,
@@ -1 +1 @@
1
- {"version":3,"file":"EmailClientProvider.js","sourceRoot":"","sources":["../../src/smtp-email-client/EmailClientProvider.ts"],"names":[],"mappings":";;;AAAA,2CAAwD;AACxD,2EAAsE;AAEzD,QAAA,mBAAmB,GAAG;IAC/B,OAAO,EAAE,iBAAiB;IAC1B,UAAU,EAAE,CAAC,MAAiC,EAAe,EAAE;QAC3D,OAAO,IAAA,4BAAe,EAAC;YACnB,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,MAAM,EAAE,MAAM,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAC9C,mEAAmE;YACnE,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM,CAAC,aAAa;gBAC1B,IAAI,EAAE,MAAM,CAAC,aAAa;aAC7B;SACJ,CAAC,CAAC;IACP,CAAC;IACD,MAAM,EAAE,CAAC,qDAAyB,CAAC;CACtC,CAAC"}
1
+ {"version":3,"file":"EmailClientProvider.js","sourceRoot":"","sources":["../../src/smtp-email-client/EmailClientProvider.ts"],"names":[],"mappings":";;;AAAA,2CAAwD;AACxD,2EAAsE;AAEzD,QAAA,wBAAwB,GAAG;IACpC,OAAO,EAAE,sBAAsB;IAC/B,UAAU,EAAE,CAAC,MAAiC,EAAe,EAAE;QAC3D,OAAO,IAAA,4BAAe,EAAC;YACnB,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,MAAM,EAAE,MAAM,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAC9C,mEAAmE;YACnE,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM,CAAC,aAAa;gBAC1B,IAAI,EAAE,MAAM,CAAC,aAAa;aAC7B;SACJ,CAAC,CAAC;IACP,CAAC;IACD,MAAM,EAAE,CAAC,qDAAyB,CAAC;CACtC,CAAC"}
@@ -61,7 +61,7 @@ let SmtpEmailClient = class SmtpEmailClient {
61
61
  SmtpEmailClient = __decorate([
62
62
  (0, common_1.Injectable)(),
63
63
  __param(1, (0, typeorm_1.InjectRepository)(email_entity_1.Email)),
64
- __param(2, (0, common_1.Inject)("SmtpEmailClient")),
64
+ __param(2, (0, common_1.Inject)("SmtpEmailTransporter")),
65
65
  __param(3, (0, bull_1.InjectQueue)(smtp_email_client_module_1.queueName)),
66
66
  __metadata("design:paramtypes", [CoreLoggerService_1.default,
67
67
  typeorm_2.Repository, Object, Object, EmailConfigurationService_1.EmailConfigurationService])
@@ -1 +1 @@
1
- {"version":3,"file":"email-client.service.js","sourceRoot":"","sources":["../../src/smtp-email-client/email-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAyC;AACzC,2CAAkD;AAClD,6CAAiD;AAGjD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,MAAM,CAAC,GAAG,CACX,yCAAyC,KAAK,CAAC,OAAO,EAAE,CAC3D,CAAC;QACF,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACJ,CAAA;AAjDY,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAIJ,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;IAEvB,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,IAAA,kBAAW,EAAC,oCAAS,CAAC,CAAA;qCALP,2BAAiB;QAER,oBAAU,kBAInB,qDAAyB;GARpC,eAAe,CAiD3B;AAjDY,0CAAe"}
1
+ {"version":3,"file":"email-client.service.js","sourceRoot":"","sources":["../../src/smtp-email-client/email-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAyC;AACzC,2CAAkD;AAClD,6CAAiD;AAGjD,qCAAmC;AACnC,oFAA4D;AAC5D,iDAAqC;AACrC,2EAAsE;AACtE,yEAAqD;AAG9C,IAAM,eAAe,GAArB,MAAM,eAAe;IACxB,YACY,MAAyB,EAEzB,eAAkC,EAElC,oBAAiC,EACT,KAAY,EACpC,MAAiC;QANjC,WAAM,GAAN,MAAM,CAAmB;QAEzB,oBAAe,GAAf,eAAe,CAAmB;QAElC,yBAAoB,GAApB,oBAAoB,CAAa;QACT,UAAK,GAAL,KAAK,CAAO;QACpC,WAAM,GAAN,MAAM,CAA2B;IAC1C,CAAC;IAEG,KAAK,CAAC,MAAM;QACf,wGAAwG;QACxG,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,QAAQ,CACjB,EAAY,EACZ,KAAe,EACf,OAAe,EACf,aAAqB,EACrB,aAAsB,EACtB,QAAiB;QAEjB,IAAI,CAAC,aAAa,IAAI,CAAC,QAAQ,EAAE;YAC7B,MAAM,IAAI,KAAK,CACX,2DAA2D,CAC9D,CAAC;SACL;QACD,MAAM,0BAA0B,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,2BAA2B,GAAG;YAChC,GAAG,KAAK;YACR,IAAI,CAAC,MAAM,CAAC,aAAa;SAC5B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;QAE5C,oEAAoE;QACpE,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,oEAAoE;QACpE,KAAK,CAAC,QAAQ,GAAG,aAAa,CAAC;QAC/B,KAAK,CAAC,KAAK,GAAG,2BAA2B,CAAC;QAC1C,KAAK,CAAC,EAAE,GAAG,0BAA0B,CAAC;QACtC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,KAAK,CAAC,OAAO,GAAG,aAAa,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,yCAAyC,KAAK,CAAC,OAAO,EAAE,CAC3D,CAAC;QACF,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACJ,CAAA;AAjDY,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAIJ,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;IAEvB,WAAA,IAAA,eAAM,EAAC,sBAAsB,CAAC,CAAA;IAE9B,WAAA,IAAA,kBAAW,EAAC,oCAAS,CAAC,CAAA;qCALP,2BAAiB;QAER,oBAAU,kBAInB,qDAAyB;GARpC,eAAe,CAiD3B;AAjDY,0CAAe"}
@@ -36,7 +36,7 @@ SmtpEmailClientModule = __decorate([
36
36
  }),
37
37
  ],
38
38
  providers: [
39
- EmailClientProvider_1.EmailClientProvider,
39
+ EmailClientProvider_1.EmailTransporterProvider,
40
40
  email_client_service_1.SmtpEmailClient,
41
41
  EmailConfigurationService_1.EmailConfigurationService,
42
42
  smtp_email_handler_1.SmtpEmailHandler,
@@ -1 +1 @@
1
- {"version":3,"file":"smtp-email-client.module.js","sourceRoot":"","sources":["../../src/smtp-email-client/smtp-email-client.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAwC;AACxC,2CAAsC;AACtC,2CAA4C;AAC5C,6CAA8C;AAC9C,2DAAqD;AACrD,iEAAuD;AACvD,yDAAyD;AACzD,iDAAqC;AACrC,+DAA0D;AAC1D,2EAAsE;AACtE,gGAA4D;AAC5D,6DAAsD;AAEzC,QAAA,SAAS,GAAG,aAAa,CAAC;AAmBhC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,qBAAqB;IAlBjC,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,UAAU,CAAC,qCAAe,CAAC;YACxC,4BAAY;YACZ,uBAAa,CAAC,UAAU,CAAC,CAAC,oBAAK,CAAC,CAAC;YACjC,iBAAU,CAAC,aAAa,CAAC;gBACrB,IAAI,EAAE,iBAAS;aAClB,CAAC;SACL;QACD,SAAS,EAAE;YACP,yCAAmB;YACnB,sCAAe;YACf,qDAAyB;YACzB,qCAAgB;SACnB;QACD,WAAW,EAAE,CAAC,wCAAqB,CAAC;QACpC,OAAO,EAAE,CAAC,sCAAe,CAAC;KAC7B,CAAC;GACW,qBAAqB,CAAG;AAAxB,sDAAqB"}
1
+ {"version":3,"file":"smtp-email-client.module.js","sourceRoot":"","sources":["../../src/smtp-email-client/smtp-email-client.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAwC;AACxC,2CAAsC;AACtC,2CAA4C;AAC5C,6CAA8C;AAC9C,2DAAqD;AACrD,iEAAuD;AACvD,yDAAyD;AACzD,iDAAqC;AACrC,+DAA+D;AAC/D,2EAAsE;AACtE,gGAA4D;AAC5D,6DAAsD;AAEzC,QAAA,SAAS,GAAG,aAAa,CAAC;AAmBhC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,qBAAqB;IAlBjC,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,UAAU,CAAC,qCAAe,CAAC;YACxC,4BAAY;YACZ,uBAAa,CAAC,UAAU,CAAC,CAAC,oBAAK,CAAC,CAAC;YACjC,iBAAU,CAAC,aAAa,CAAC;gBACrB,IAAI,EAAE,iBAAS;aAClB,CAAC;SACL;QACD,SAAS,EAAE;YACP,8CAAwB;YACxB,sCAAe;YACf,qDAAyB;YACzB,qCAAgB;SACnB;QACD,WAAW,EAAE,CAAC,wCAAqB,CAAC;QACpC,OAAO,EAAE,CAAC,sCAAe,CAAC;KAC7B,CAAC;GACW,qBAAqB,CAAG;AAAxB,sDAAqB"}
@@ -19,6 +19,7 @@ const config_1 = require("@nestjs/config");
19
19
  const core_app_module_1 = require("../root-app/core-app.module");
20
20
  const StripeClientProvider_1 = require("./StripeClientProvider");
21
21
  const bull_1 = require("@nestjs/bull");
22
+ const stripe_controller_1 = require("./stripe-controller");
22
23
  exports.queueName = "stripe-events";
23
24
  let StripeAccountModule = class StripeAccountModule {
24
25
  };
@@ -37,7 +38,7 @@ StripeAccountModule = __decorate([
37
38
  stripe_checkout_service_1.StripeCheckoutService,
38
39
  ],
39
40
  exports: [stripe_checkout_service_1.StripeCheckoutService],
40
- controllers: [],
41
+ controllers: [stripe_controller_1.StripeClientController],
41
42
  })
42
43
  ], StripeAccountModule);
43
44
  exports.StripeAccountModule = StripeAccountModule;
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-account.module.js","sourceRoot":"","sources":["../../src/stripe-client/stripe-account.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAsC;AACtC,4BAA0B;AAC1B,yFAAoF;AACpF,gFAAyE;AACzE,kGAA6D;AAC7D,2CAA4C;AAC5C,iEAAuD;AACvD,iEAA4D;AAC5D,uCAAwC;AAE3B,QAAA,SAAS,GAAG,eAAe,CAAC;AAiBlC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,mBAAmB;IAhB/B,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,UAAU,CAAC,sCAAe,CAAC;YACxC,4BAAU;YACV,iBAAU,CAAC,aAAa,CAAC;gBACrB,IAAI,EAAE,iBAAS;aAClB,CAAC;SACL;QACD,SAAS,EAAE;YACP,2CAAoB;YACpB,mEAAgC;YAChC,+CAAqB;SACxB;QACD,OAAO,EAAE,CAAC,+CAAqB,CAAC;QAChC,WAAW,EAAE,EAAE;KAClB,CAAC;GACW,mBAAmB,CAAG;AAAtB,kDAAmB"}
1
+ {"version":3,"file":"stripe-account.module.js","sourceRoot":"","sources":["../../src/stripe-client/stripe-account.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAsC;AACtC,4BAA0B;AAC1B,yFAAoF;AACpF,gFAAyE;AACzE,kGAA6D;AAC7D,2CAA4C;AAC5C,iEAAuD;AACvD,iEAA4D;AAC5D,uCAAwC;AACxC,2DAA2D;AAE9C,QAAA,SAAS,GAAG,eAAe,CAAC;AAiBlC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,mBAAmB;IAhB/B,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,UAAU,CAAC,sCAAe,CAAC;YACxC,4BAAU;YACV,iBAAU,CAAC,aAAa,CAAC;gBACrB,IAAI,EAAE,iBAAS;aAClB,CAAC;SACL;QACD,SAAS,EAAE;YACP,2CAAoB;YACpB,mEAAgC;YAChC,+CAAqB;SACxB;QACD,OAAO,EAAE,CAAC,+CAAqB,CAAC;QAChC,WAAW,EAAE,CAAC,0CAAsB,CAAC;KACxC,CAAC;GACW,mBAAmB,CAAG;AAAtB,kDAAmB"}
@@ -4,7 +4,7 @@ import { StripeCheckoutSessionParameters } from "./models/StripeCheckoutSessionP
4
4
  import { StripeCheckoutService } from "./services/stripe-checkout.service";
5
5
  import { Request as ExpressRequest } from "express";
6
6
  import { StripeWebhookHandler } from "./services/stripe-webhook-handler.service";
7
- export declare class OrganisationController {
7
+ export declare class StripeClientController {
8
8
  private readonly stripeService;
9
9
  private readonly stripeWebhookService;
10
10
  constructor(stripeService: StripeCheckoutService, stripeWebhookService: StripeWebhookHandler);
@@ -12,14 +12,14 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.OrganisationController = void 0;
15
+ exports.StripeClientController = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const passport_1 = require("@nestjs/passport");
18
18
  const swagger_1 = require("@nestjs/swagger");
19
19
  const StripeCheckoutSessionParams_1 = require("./models/StripeCheckoutSessionParams");
20
20
  const stripe_checkout_service_1 = require("./services/stripe-checkout.service");
21
21
  const stripe_webhook_handler_service_1 = require("./services/stripe-webhook-handler.service");
22
- let OrganisationController = class OrganisationController {
22
+ let StripeClientController = class StripeClientController {
23
23
  constructor(stripeService, stripeWebhookService) {
24
24
  this.stripeService = stripeService;
25
25
  this.stripeWebhookService = stripeWebhookService;
@@ -50,7 +50,7 @@ __decorate([
50
50
  __metadata("design:type", Function),
51
51
  __metadata("design:paramtypes", [Object]),
52
52
  __metadata("design:returntype", Promise)
53
- ], OrganisationController.prototype, "webhookReceiver", null);
53
+ ], StripeClientController.prototype, "webhookReceiver", null);
54
54
  __decorate([
55
55
  (0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
56
56
  (0, swagger_1.ApiBearerAuth)(),
@@ -62,7 +62,7 @@ __decorate([
62
62
  __metadata("design:type", Function),
63
63
  __metadata("design:paramtypes", [Object]),
64
64
  __metadata("design:returntype", Promise)
65
- ], OrganisationController.prototype, "createCustomerPortalSession", null);
65
+ ], StripeClientController.prototype, "createCustomerPortalSession", null);
66
66
  __decorate([
67
67
  (0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
68
68
  (0, swagger_1.ApiBearerAuth)(),
@@ -75,12 +75,12 @@ __decorate([
75
75
  __metadata("design:type", Function),
76
76
  __metadata("design:paramtypes", [Object, StripeCheckoutSessionParams_1.StripeCheckoutSessionParameters]),
77
77
  __metadata("design:returntype", Promise)
78
- ], OrganisationController.prototype, "createCheckoutSession", null);
79
- OrganisationController = __decorate([
78
+ ], StripeClientController.prototype, "createCheckoutSession", null);
79
+ StripeClientController = __decorate([
80
80
  (0, common_1.Controller)("payments/stripe"),
81
81
  (0, swagger_1.ApiTags)("payments"),
82
82
  __metadata("design:paramtypes", [stripe_checkout_service_1.StripeCheckoutService,
83
83
  stripe_webhook_handler_service_1.StripeWebhookHandler])
84
- ], OrganisationController);
85
- exports.OrganisationController = OrganisationController;
84
+ ], StripeClientController);
85
+ exports.StripeClientController = StripeClientController;
86
86
  //# sourceMappingURL=stripe-controller.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darraghor/nest-backend-libs",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Some helpers for personal projects in nestjs",
6
6
  "homepage": "https://github.com/darraghoriordan/nest-backend-libs",
@@ -26,6 +26,10 @@
26
26
  "keywords": [
27
27
  "nestjs"
28
28
  ],
29
+ "bin": {
30
+ "write-db-config": "dist/database-postgres/write-typeorm-config.js",
31
+ "generate-client": "dist/open-api-generation/generate.sh"
32
+ },
29
33
  "scripts": {
30
34
  "clean": "rm -Rf ./dist/",
31
35
  "build:ci": "yarn build",