@darraghor/nest-backend-libs 2.0.0 → 2.1.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/index.d.ts +4 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/invitations/InvitationConfigurationService.d.ts +7 -0
- package/dist/invitations/InvitationConfigurationService.js +38 -0
- package/dist/invitations/InvitationConfigurationService.js.map +1 -0
- package/dist/invitations/InvitationConfigurationVariables.d.ts +6 -0
- package/dist/invitations/InvitationConfigurationVariables.js +7 -0
- package/dist/invitations/InvitationConfigurationVariables.js.map +1 -0
- package/dist/invitations/dto/create-invitation.dto.d.ts +5 -0
- package/dist/invitations/dto/create-invitation.dto.js +29 -0
- package/dist/invitations/dto/create-invitation.dto.js.map +1 -0
- package/dist/invitations/entities/invitation.entity.d.ts +14 -0
- package/dist/invitations/entities/invitation.entity.js +85 -0
- package/dist/invitations/entities/invitation.entity.js.map +1 -0
- package/dist/invitations/invitation.controller.d.ts +10 -0
- package/dist/invitations/invitation.controller.js +60 -0
- package/dist/invitations/invitation.controller.js.map +1 -0
- package/dist/invitations/invitation.module.d.ts +2 -0
- package/dist/invitations/invitation.module.js +41 -0
- package/dist/invitations/invitation.module.js.map +1 -0
- package/dist/invitations/invitation.service.d.ts +16 -0
- package/dist/invitations/invitation.service.js +92 -0
- package/dist/invitations/invitation.service.js.map +1 -0
- package/dist/organisation/entities/organisation.entity.d.ts +2 -0
- package/dist/organisation/entities/organisation.entity.js +9 -0
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/smtp-email-client/EmailClientProvider.d.ts +1 -1
- package/dist/smtp-email-client/EmailClientProvider.js +3 -3
- package/dist/smtp-email-client/EmailClientProvider.js.map +1 -1
- package/dist/smtp-email-client/email-client.service.js +1 -1
- package/dist/smtp-email-client/email-client.service.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.js +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.js +2 -1
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-controller.d.ts +1 -1
- package/dist/stripe-client/stripe-controller.js +8 -8
- package/package.json +1 -1
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
|
-
|
|
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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAA+C;AAC/C,8FAAwF;AAuDpF,yGAvDI,oDAAwB,OAuDJ;AAtD5B,oFAA6E;AAoDzE,qGApDI,6CAAoB,OAoDJ;AAnDxB,2FAAmF;AAgC/E,sGAhCI,gDAAqB,OAgCJ;AA/BzB,mDAA+C;AAmD3C,gGAnDI,gCAAe,OAmDJ;AAlDnB,uDAAiD;AAqC7C,4FArCI,0BAAW,OAqCJ;AApCf,yDAAkD;AAmC9C,4FAnCI,2BAAW,OAmCJ;AAlCf,+DAA0D;AAgCtD,iGAhCI,mCAAgB,OAgCJ;AA9BpB,iGAA4F;AAqCxF,8GArCI,6DAA6B,OAqCJ;AApCjC,qFAAgF;AAwB5E,yGAxBI,mDAAwB,OAwBJ;AAvB5B,yFAAmF;AA6BrD,+FA7BtB,gDAAsB,OA6Bc;AA5B5C,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,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,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,GAA1B,MAAM,oBAAoB;IAC7B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAI/D,AAAN,KAAK,CAAC,MAAM,CACA,SAA8B,EAC3B,OAAwB;QAEnC,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACO,IAAY,EAChB,OAAwB;QAEnC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CACpD,IAAI,EACJ,OAAO,CAAC,IAAI,CAAC,EAAE,CAClB,CAAC;QAEF,OAAO,YAAY,CAAC,WAAW,KAAK,SAAS,CAAC;IAClD,CAAC;CACJ,CAAA;AApBS;IAFL,IAAA,aAAI,GAAE;IACN,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,8BAAU,EAAC,CAAC;IAE7B,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,gBAAO,GAAE,CAAA;;qCADS,2CAAmB;;kDAIzC;AAIK;IAFL,IAAA,eAAM,EAAC,OAAO,CAAC;IACf,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,8BAAU,EAAC,CAAC;IAE7B,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;kDAQb;AAxBQ,oBAAoB;IAJhC,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,aAAa,CAAC;IACzB,IAAA,iBAAO,EAAC,eAAe,CAAC;qCAE2B,sCAAiB;GADxD,oBAAoB,CAyBhC;AAzBY,oDAAoB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 __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":"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"}
|
|
@@ -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;
|
|
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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transporter } from "nodemailer";
|
|
2
2
|
import { EmailConfigurationService } from "./EmailConfigurationService";
|
|
3
|
-
export declare const
|
|
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.
|
|
3
|
+
exports.EmailTransporterProvider = void 0;
|
|
4
4
|
const nodemailer_1 = require("nodemailer");
|
|
5
5
|
const EmailConfigurationService_1 = require("./EmailConfigurationService");
|
|
6
|
-
exports.
|
|
7
|
-
provide: "
|
|
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,
|
|
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)("
|
|
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,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,
|
|
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.
|
|
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,+
|
|
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;
|
|
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
|
|
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.
|
|
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
|
|
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
|
-
],
|
|
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
|
-
],
|
|
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
|
-
],
|
|
79
|
-
|
|
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
|
-
],
|
|
85
|
-
exports.
|
|
84
|
+
], StripeClientController);
|
|
85
|
+
exports.StripeClientController = StripeClientController;
|
|
86
86
|
//# sourceMappingURL=stripe-controller.js.map
|
package/package.json
CHANGED