@darraghor/nest-backend-libs 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authz/AccessToken.js +1 -2
- package/dist/authz/AuthConfigurationService.js +12 -15
- package/dist/authz/AuthConfigurationService.js.map +1 -1
- package/dist/authz/AuthConfigurationVariables.js +2 -4
- package/dist/authz/AuthConfigurationVariables.js.map +1 -1
- package/dist/authz/ClaimsAuthorisationGuard.js +7 -13
- package/dist/authz/ClaimsAuthorisationGuard.js.map +1 -1
- package/dist/authz/DefaultAuthGuard.js +5 -8
- package/dist/authz/DefaultAuthGuard.js.map +1 -1
- package/dist/authz/MandatoryUserClaims.decorator.js +2 -6
- package/dist/authz/MandatoryUserClaims.decorator.js.map +1 -1
- package/dist/authz/RequestWithUser.js +1 -2
- package/dist/authz/authz.module.js +17 -23
- package/dist/authz/authz.module.js.map +1 -1
- package/dist/authz/authzstrategy.js +16 -22
- package/dist/authz/authzstrategy.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationService.js +10 -13
- package/dist/authzclient/AuthClientConfigurationService.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationVariables.js +2 -4
- package/dist/authzclient/AuthClientConfigurationVariables.js.map +1 -1
- package/dist/authzclient/AuthzClientProvider.js +5 -8
- package/dist/authzclient/AuthzClientProvider.js.map +1 -1
- package/dist/authzclient/UserProfile.dto.js +1 -5
- package/dist/authzclient/UserProfile.dto.js.map +1 -1
- package/dist/authzclient/authz-client.module.js +13 -19
- package/dist/authzclient/authz-client.module.js.map +1 -1
- package/dist/authzclient/authz.service.js +8 -14
- package/dist/authzclient/authz.service.js.map +1 -1
- package/dist/cli/cli.js +7 -12
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/commands/WriteApiClientCommand.js +6 -13
- package/dist/cli/commands/WriteApiClientCommand.js.map +1 -1
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js +11 -18
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js.map +1 -1
- package/dist/configuration/ValidatedConfigurationService.js +5 -8
- package/dist/configuration/ValidatedConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfig.module.js +9 -15
- package/dist/core-config/CoreConfig.module.js.map +1 -1
- package/dist/core-config/CoreConfigurationService.js +22 -25
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfigurationVariables.js +2 -4
- package/dist/core-config/CoreConfigurationVariables.js.map +1 -1
- package/dist/database-postgres/PostgresDatabase.module.js +11 -14
- package/dist/database-postgres/PostgresDatabase.module.js.map +1 -1
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js +5 -8
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js.map +1 -1
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js +5 -12
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabase.module.js +11 -14
- package/dist/database-sqlite/SqliteDatabase.module.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js +5 -8
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js.map +1 -1
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js +5 -12
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/index.js +30 -64
- package/dist/index.js.map +1 -1
- package/dist/invitations/InvitationConfigurationService.js +10 -13
- package/dist/invitations/InvitationConfigurationService.js.map +1 -1
- package/dist/invitations/InvitationConfigurationVariables.js +2 -4
- package/dist/invitations/InvitationConfigurationVariables.js.map +1 -1
- package/dist/invitations/dto/create-invitation.dto.js +5 -9
- package/dist/invitations/dto/create-invitation.dto.js.map +1 -1
- package/dist/invitations/entities/invitation.entity.js +30 -33
- package/dist/invitations/entities/invitation.entity.js.map +1 -1
- package/dist/invitations/invitation.controller.js +21 -24
- package/dist/invitations/invitation.controller.js.map +1 -1
- package/dist/invitations/invitation.module.js +21 -27
- package/dist/invitations/invitation.module.js.map +1 -1
- package/dist/invitations/invitation.service.js +18 -21
- package/dist/invitations/invitation.service.js.map +1 -1
- package/dist/logger/CoreLoggerService.js +7 -9
- package/dist/logger/CoreLoggerService.js.map +1 -1
- package/dist/logger/LoggingConfigurationService.js +12 -15
- package/dist/logger/LoggingConfigurationService.js.map +1 -1
- package/dist/logger/LoggingConfigurationVariables.js +2 -4
- package/dist/logger/LoggingConfigurationVariables.js.map +1 -1
- package/dist/logger/LoggingInterceptor.js +7 -13
- package/dist/logger/LoggingInterceptor.js.map +1 -1
- package/dist/logger/logger.module.js +14 -20
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/organisation/dto/RolesEnum.js +2 -5
- package/dist/organisation/dto/RolesEnum.js.map +1 -1
- package/dist/organisation/dto/create-organisation.dto.js +7 -11
- package/dist/organisation/dto/create-organisation.dto.js.map +1 -1
- package/dist/organisation/dto/update-organisation.dto.js +3 -7
- package/dist/organisation/dto/update-organisation.dto.js.map +1 -1
- package/dist/organisation/entities/member-role.entity.js +20 -23
- package/dist/organisation/entities/member-role.entity.js.map +1 -1
- package/dist/organisation/entities/organisation-membership.entity.js +37 -40
- package/dist/organisation/entities/organisation-membership.entity.js.map +1 -1
- package/dist/organisation/entities/organisation.entity.js +26 -29
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/organisation/organisation.controller.js +29 -32
- package/dist/organisation/organisation.controller.js.map +1 -1
- package/dist/organisation/organisation.module.js +12 -15
- package/dist/organisation/organisation.module.js.map +1 -1
- package/dist/organisation/organisation.service.js +20 -23
- package/dist/organisation/organisation.service.js.map +1 -1
- package/dist/person/dto/create-person.dto.js +1 -5
- package/dist/person/dto/create-person.dto.js.map +1 -1
- package/dist/person/dto/update-person.dto.js +3 -7
- package/dist/person/dto/update-person.dto.js.map +1 -1
- package/dist/person/entities/person.entity.js +41 -44
- package/dist/person/entities/person.entity.js.map +1 -1
- package/dist/person/person.controller.js +25 -28
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.module.js +15 -18
- package/dist/person/person.module.js.map +1 -1
- package/dist/person/person.service.js +22 -28
- package/dist/person/person.service.js.map +1 -1
- package/dist/root-app/SwaggerGen.js +15 -21
- package/dist/root-app/SwaggerGen.js.map +1 -1
- package/dist/root-app/app.controller.js +17 -23
- package/dist/root-app/app.controller.js.map +1 -1
- package/dist/root-app/app.service.js +3 -6
- package/dist/root-app/app.service.js.map +1 -1
- package/dist/root-app/core-app.module.js +26 -32
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/root-app/notfound.interceptor.js +6 -9
- package/dist/root-app/notfound.interceptor.js.map +1 -1
- package/dist/runningCommandLine/CliCommandService.js +8 -14
- package/dist/runningCommandLine/CliCommandService.js.map +1 -1
- package/dist/runningCommandLine/RunningCommandLine.module.js +9 -12
- package/dist/runningCommandLine/RunningCommandLine.module.js.map +1 -1
- package/dist/smtp-email-client/EmailClientProvider.js +5 -8
- package/dist/smtp-email-client/EmailClientProvider.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.js +24 -27
- package/dist/smtp-email-client/EmailConfigurationService.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.js +2 -4
- package/dist/smtp-email-client/EmailConfigurationVariables.js.map +1 -1
- package/dist/smtp-email-client/email-client.service.js +15 -21
- package/dist/smtp-email-client/email-client.service.js.map +1 -1
- package/dist/smtp-email-client/email.controller.js +12 -15
- package/dist/smtp-email-client/email.controller.js.map +1 -1
- package/dist/smtp-email-client/email.entity.js +32 -35
- package/dist/smtp-email-client/email.entity.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.js +26 -32
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-handler.js +15 -21
- package/dist/smtp-email-client/smtp-email-handler.js.map +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.js +14 -17
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/StripeClientProvider.js +5 -11
- package/dist/stripe-client/StripeClientProvider.js.map +1 -1
- package/dist/stripe-client/StripeConfigurationVariables.js +2 -4
- package/dist/stripe-client/StripeConfigurationVariables.js.map +1 -1
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js +19 -24
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js.map +1 -1
- package/dist/stripe-client/services/stripe-checkout.service.js +10 -16
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/services/stripe-event-handler.js +12 -18
- package/dist/stripe-client/services/stripe-event-handler.js.map +1 -1
- package/dist/stripe-client/services/stripe-webhook-handler.service.js +13 -19
- package/dist/stripe-client/services/stripe-webhook-handler.service.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.js +22 -28
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-controller.js +27 -30
- package/dist/stripe-client/stripe-controller.js.map +1 -1
- package/dist/testing/preRun.js +1 -3
- package/dist/testing/preRun.js.map +1 -1
- package/dist/twitter-client/TwitterClientConfigurationService.js +16 -19
- package/dist/twitter-client/TwitterClientConfigurationService.js.map +1 -1
- package/dist/twitter-client/TwitterClientProvider.js +5 -8
- package/dist/twitter-client/TwitterClientProvider.js.map +1 -1
- package/dist/twitter-client/TwitterConfigurationVariables.js +2 -4
- package/dist/twitter-client/TwitterConfigurationVariables.js.map +1 -1
- package/dist/twitter-client/services/twitter-client.service.js +8 -14
- package/dist/twitter-client/services/twitter-client.service.js.map +1 -1
- package/dist/twitter-client/twitter-account.module.js +15 -21
- package/dist/twitter-client/twitter-account.module.js.map +1 -1
- package/package.json +1 -1
- package/dist/database-postgres/write-typeorm-config.d.ts +0 -2
- package/dist/database-postgres/write-typeorm-config.js +0 -14
- package/dist/database-postgres/write-typeorm-config.js.map +0 -1
- package/dist/database-sqlite/write-typeorm-config.d.ts +0 -1
- package/dist/database-sqlite/write-typeorm-config.js +0 -13
- package/dist/database-sqlite/write-typeorm-config.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,17 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const typeorm_1 = require("typeorm");
|
|
19
|
-
const CoreLoggerService_1 = __importDefault(require("../logger/CoreLoggerService"));
|
|
20
|
-
const EmailConfigurationService_1 = require("./EmailConfigurationService");
|
|
21
|
-
const smtp_email_client_module_1 = require("./smtp-email-client.module");
|
|
10
|
+
import { Processor, OnQueueFailed, OnQueueActive, OnQueueCompleted, Process, } from "@nestjs/bull";
|
|
11
|
+
import { Injectable } from "@nestjs/common";
|
|
12
|
+
import { Repository } from "typeorm";
|
|
13
|
+
import CoreLoggerService from "../logger/CoreLoggerService";
|
|
14
|
+
import { EmailConfigurationService } from "./EmailConfigurationService";
|
|
15
|
+
import { queueName } from "./smtp-email-client.module";
|
|
22
16
|
let SmtpEmailHandler = class SmtpEmailHandler {
|
|
23
17
|
config;
|
|
24
18
|
emailRepository;
|
|
@@ -75,13 +69,13 @@ let SmtpEmailHandler = class SmtpEmailHandler {
|
|
|
75
69
|
}
|
|
76
70
|
};
|
|
77
71
|
__decorate([
|
|
78
|
-
|
|
72
|
+
OnQueueFailed(),
|
|
79
73
|
__metadata("design:type", Function),
|
|
80
74
|
__metadata("design:paramtypes", [Object, Object]),
|
|
81
75
|
__metadata("design:returntype", void 0)
|
|
82
76
|
], SmtpEmailHandler.prototype, "onError", null);
|
|
83
77
|
__decorate([
|
|
84
|
-
|
|
78
|
+
OnQueueActive()
|
|
85
79
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
86
80
|
,
|
|
87
81
|
__metadata("design:type", Function),
|
|
@@ -89,7 +83,7 @@ __decorate([
|
|
|
89
83
|
__metadata("design:returntype", void 0)
|
|
90
84
|
], SmtpEmailHandler.prototype, "onActive", null);
|
|
91
85
|
__decorate([
|
|
92
|
-
|
|
86
|
+
OnQueueCompleted()
|
|
93
87
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
94
88
|
,
|
|
95
89
|
__metadata("design:type", Function),
|
|
@@ -97,16 +91,16 @@ __decorate([
|
|
|
97
91
|
__metadata("design:returntype", void 0)
|
|
98
92
|
], SmtpEmailHandler.prototype, "onComplete", null);
|
|
99
93
|
__decorate([
|
|
100
|
-
|
|
94
|
+
Process(),
|
|
101
95
|
__metadata("design:type", Function),
|
|
102
96
|
__metadata("design:paramtypes", [Object]),
|
|
103
97
|
__metadata("design:returntype", Promise)
|
|
104
98
|
], SmtpEmailHandler.prototype, "handleEvent", null);
|
|
105
99
|
SmtpEmailHandler = __decorate([
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
__metadata("design:paramtypes", [
|
|
109
|
-
|
|
100
|
+
Injectable(),
|
|
101
|
+
Processor(queueName),
|
|
102
|
+
__metadata("design:paramtypes", [EmailConfigurationService,
|
|
103
|
+
Repository, Object, CoreLoggerService])
|
|
110
104
|
], SmtpEmailHandler);
|
|
111
|
-
|
|
105
|
+
export { SmtpEmailHandler };
|
|
112
106
|
//# sourceMappingURL=smtp-email-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smtp-email-handler.js","sourceRoot":"","sources":["../../src/smtp-email-client/smtp-email-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smtp-email-handler.js","sourceRoot":"","sources":["../../src/smtp-email-client/smtp-email-handler.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,SAAS,EACT,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,OAAO,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAI1C,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAI9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAEb;IACA;IACA;IACS;IAJrB,YACY,MAAiC,EACjC,eAAkC,EAClC,oBAAiC,EACxB,MAAyB;QAHlC,WAAM,GAAN,MAAM,CAA2B;QACjC,oBAAe,GAAf,eAAe,CAAmB;QAClC,yBAAoB,GAApB,oBAAoB,CAAa;QACxB,WAAM,GAAN,MAAM,CAAmB;IAC3C,CAAC;IAGJ,OAAO,CAAC,GAAe,EAAE,KAAU;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK;QACb,0KAA0K;QAC1K,cAAc,GAAG,CAAC,EAAE,YAAY,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,OAAc,EAAE;QACnE,sEAAsE;QACtE,KAAK,CAAC,KAAK,CACd,CAAC;IACN,CAAC;IAGD,0DAA0D;IAC1D,QAAQ,CAAC,GAAe;QACpB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,EAAE,YAAY,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;IAGD,0DAA0D;IAC1D,UAAU,CAAC,GAAe;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,iBAAiB,GAAG,CAAC,EAAE,YAAY,G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I,CAAC,CAAC;IAC1B,CAAC;CACJ,CAAA;AA5DG;IAAC,aAAa,EAAE;;;;+CAQf;AAED;IAAC,aAAa,EAAE;IAChB,0DAA0D;;;;;gDAGzD;AAED;IAAC,gBAAgB,EAAE;IACnB,0DAA0D;;;;;kDAMzD;AAIY;IADZ,OAAO,EAAE;;;;mDAiCT;AAnEQ,gBAAgB;IAF5B,UAAU,EAAE;IACZ,SAAS,CAAC,SAAS,CAAC;qCAGG,yBAAyB;QAChB,UAAU,UAEV,iBAAiB;GALrC,gBAAgB,CAoE5B;SApEY,gBAAgB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,14 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.StripeClientConfigurationService = void 0;
|
|
13
10
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let StripeClientConfigurationService = class StripeClientConfigurationService extends
|
|
11
|
+
import { Injectable } from "@nestjs/common";
|
|
12
|
+
import { ConfigService } from "@nestjs/config";
|
|
13
|
+
import { IsDefined, IsString } from "class-validator";
|
|
14
|
+
import { ValidatedConfigurationService } from "../configuration/ValidatedConfigurationService";
|
|
15
|
+
let StripeClientConfigurationService = class StripeClientConfigurationService extends ValidatedConfigurationService {
|
|
19
16
|
configService;
|
|
20
17
|
constructor(configService) {
|
|
21
18
|
super();
|
|
@@ -32,26 +29,26 @@ let StripeClientConfigurationService = class StripeClientConfigurationService ex
|
|
|
32
29
|
}
|
|
33
30
|
};
|
|
34
31
|
__decorate([
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
IsDefined(),
|
|
33
|
+
IsString(),
|
|
37
34
|
__metadata("design:type", String),
|
|
38
35
|
__metadata("design:paramtypes", [])
|
|
39
36
|
], StripeClientConfigurationService.prototype, "accessToken", null);
|
|
40
37
|
__decorate([
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
IsDefined(),
|
|
39
|
+
IsString(),
|
|
43
40
|
__metadata("design:type", String),
|
|
44
41
|
__metadata("design:paramtypes", [])
|
|
45
42
|
], StripeClientConfigurationService.prototype, "webhookVerificationKey", null);
|
|
46
43
|
__decorate([
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
IsDefined(),
|
|
45
|
+
IsString(),
|
|
49
46
|
__metadata("design:type", String),
|
|
50
47
|
__metadata("design:paramtypes", [])
|
|
51
48
|
], StripeClientConfigurationService.prototype, "stripeRedirectsBaseUrl", null);
|
|
52
49
|
StripeClientConfigurationService = __decorate([
|
|
53
|
-
|
|
54
|
-
__metadata("design:paramtypes", [
|
|
50
|
+
Injectable(),
|
|
51
|
+
__metadata("design:paramtypes", [ConfigService])
|
|
55
52
|
], StripeClientConfigurationService);
|
|
56
|
-
|
|
53
|
+
export { StripeClientConfigurationService };
|
|
57
54
|
//# sourceMappingURL=StripeClientConfigurationService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeClientConfigurationService.js","sourceRoot":"","sources":["../../src/stripe-client/StripeClientConfigurationService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeClientConfigurationService.js","sourceRoot":"","sources":["../../src/stripe-client/StripeClientConfigurationService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6DAA6D;AAC7D,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,6BAA6B,EAAC,MAAM,gDAAgD,CAAC;AAGtF,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,6BAA6B;IAC3D;IAApB,YAAoB,aAA4B;QAC5C,KAAK,EAAE,CAAC;QADQ,kBAAa,GAAb,aAAa,CAAe;IAEhD,CAAC;IAED,IAEI,WAAW;QACX,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,2BAA2B,CAAE,CAAC;IACxE,CAAC;IAED,IAEI,sBAAsB;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CACzB,sCAAsC,CACxC,CAAC;IACP,CAAC;IAED,IAEI,sBAAsB;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CACzB,sCAAsC,CACxC,CAAC;IACP,CAAC;CACJ,CAAA;AArBG;IAAC,SAAS,EAAE;IACX,QAAQ,EAAE;;;mEAGV;AAED;IAAC,SAAS,EAAE;IACX,QAAQ,EAAE;;;8EAKV;AAED;IAAC,SAAS,EAAE;IACX,QAAQ,EAAE;;;8EAKV;AAzBQ,gCAAgC;IAD5C,UAAU,EAAE;qCAE0B,aAAa;GADvC,gCAAgC,CA0B5C;SA1BY,gCAAgC"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StripeClientProvider = void 0;
|
|
7
|
-
const stripe_1 = __importDefault(require("stripe"));
|
|
8
|
-
const StripeClientConfigurationService_1 = require("./StripeClientConfigurationService");
|
|
9
|
-
exports.StripeClientProvider = {
|
|
1
|
+
import Stripe from "stripe";
|
|
2
|
+
import { StripeClientConfigurationService } from "./StripeClientConfigurationService";
|
|
3
|
+
export const StripeClientProvider = {
|
|
10
4
|
provide: "StripeClient",
|
|
11
5
|
useFactory: (config) => {
|
|
12
6
|
const apiVersion = "2022-11-15";
|
|
@@ -15,8 +9,8 @@ exports.StripeClientProvider = {
|
|
|
15
9
|
url: "https://github.com/darraghoriordan/nest-backend-libs", // Optional
|
|
16
10
|
};
|
|
17
11
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
|
|
18
|
-
return new
|
|
12
|
+
return new Stripe(config.accessToken, { apiVersion, appInfo });
|
|
19
13
|
},
|
|
20
|
-
inject: [
|
|
14
|
+
inject: [StripeClientConfigurationService],
|
|
21
15
|
};
|
|
22
16
|
//# sourceMappingURL=StripeClientProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeClientProvider.js","sourceRoot":"","sources":["../../src/stripe-client/StripeClientProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeClientProvider.js","sourceRoot":"","sources":["../../src/stripe-client/StripeClientProvider.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,gCAAgC,EAAC,MAAM,oCAAoC,CAAC;AAEpF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,OAAO,EAAE,cAAc;IACvB,UAAU,EAAE,CAAC,MAAwC,EAAU,EAAE;QAC7D,MAAM,UAAU,GAAG,YAAY,CAAC;QAChC,MAAM,OAAO,GAAG;YACZ,IAAI,EAAE,iBAAiB;YACvB,GAAG,EAAE,sDAAsD,EAAE,WAAW;SAC3E,CAAC;QACF,kGAAkG;QAClG,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAC,UAAU,EAAE,OAAO,EAAC,CAAC,CAAC;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,gCAAgC,CAAC;CAC7C,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const config_1 = require("@nestjs/config");
|
|
4
|
-
exports.default = (0, config_1.registerAs)("stripe-client", () => ({
|
|
1
|
+
import { registerAs } from "@nestjs/config";
|
|
2
|
+
export default registerAs("stripe-client", () => ({
|
|
5
3
|
accessToken: process.env.STRIPE_ACCESS_TOKEN,
|
|
6
4
|
webhookVerificationKey: process.env.STRIPE_WEBHOOK_VERIFICATION_KEY,
|
|
7
5
|
stripeRedirectsBaseUrl: process.env.STRIPE_REDIRECTS_BASE_URL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeConfigurationVariables.js","sourceRoot":"","sources":["../../src/stripe-client/StripeConfigurationVariables.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeConfigurationVariables.js","sourceRoot":"","sources":["../../src/stripe-client/StripeConfigurationVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE1C,eAAe,UAAU,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB;IAC5C,sBAAsB,EAAE,OAAO,CAAC,GAAG,CAAC,+BAA+B;IACnE,sBAAsB,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;CAChE,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// this just exists to avoid having to import the stripe lib directly
|
|
3
2
|
// not sure if a great idea but let's see!
|
|
4
3
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -10,25 +9,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
10
9
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
10
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const class_validator_1 = require("class-validator");
|
|
18
|
-
class StripeCheckoutLineItem {
|
|
12
|
+
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
13
|
+
import { Type } from "class-transformer";
|
|
14
|
+
import { IsArray, IsIn, IsOptional, IsString, ValidateNested, } from "class-validator";
|
|
15
|
+
export class StripeCheckoutLineItem {
|
|
19
16
|
price;
|
|
20
17
|
quantity;
|
|
21
18
|
}
|
|
22
19
|
__decorate([
|
|
23
|
-
|
|
20
|
+
ApiProperty(),
|
|
24
21
|
__metadata("design:type", String)
|
|
25
22
|
], StripeCheckoutLineItem.prototype, "price", void 0);
|
|
26
23
|
__decorate([
|
|
27
|
-
|
|
24
|
+
ApiProperty(),
|
|
28
25
|
__metadata("design:type", Number)
|
|
29
26
|
], StripeCheckoutLineItem.prototype, "quantity", void 0);
|
|
30
|
-
|
|
31
|
-
class StripeCheckoutSessionParameters {
|
|
27
|
+
export class StripeCheckoutSessionParameters {
|
|
32
28
|
clientReferenceId;
|
|
33
29
|
lineItems;
|
|
34
30
|
// eslint-disable-next-line @darraghor/nestjs-typed/validated-non-primitive-property-needs-type-decorator
|
|
@@ -37,35 +33,34 @@ class StripeCheckoutSessionParameters {
|
|
|
37
33
|
cancelFrontendPath;
|
|
38
34
|
}
|
|
39
35
|
__decorate([
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
ApiPropertyOptional(),
|
|
37
|
+
IsOptional(),
|
|
42
38
|
__metadata("design:type", String)
|
|
43
39
|
], StripeCheckoutSessionParameters.prototype, "clientReferenceId", void 0);
|
|
44
40
|
__decorate([
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
ApiProperty({ isArray: true, type: StripeCheckoutLineItem }),
|
|
42
|
+
IsArray(),
|
|
43
|
+
ValidateNested({ each: true }),
|
|
44
|
+
Type(() => StripeCheckoutLineItem),
|
|
49
45
|
__metadata("design:type", Array)
|
|
50
46
|
], StripeCheckoutSessionParameters.prototype, "lineItems", void 0);
|
|
51
47
|
__decorate([
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
ApiProperty({ type: String }),
|
|
49
|
+
IsIn(["subscription", "payment", "setup"]),
|
|
54
50
|
__metadata("design:type", String)
|
|
55
51
|
], StripeCheckoutSessionParameters.prototype, "mode", void 0);
|
|
56
52
|
__decorate([
|
|
57
|
-
|
|
53
|
+
ApiProperty({
|
|
58
54
|
description: "The URL to which Stripe should redirect the customer after payment. This is appended to the host configured in the StripeClientConfigurationService",
|
|
59
55
|
}),
|
|
60
|
-
|
|
56
|
+
IsString(),
|
|
61
57
|
__metadata("design:type", String)
|
|
62
58
|
], StripeCheckoutSessionParameters.prototype, "successFrontendPath", void 0);
|
|
63
59
|
__decorate([
|
|
64
|
-
|
|
60
|
+
ApiPropertyOptional({
|
|
65
61
|
description: "The URL to which Stripe should redirect the customer after payment cancellation. This is appended to the host configured in the StripeClientConfigurationService",
|
|
66
62
|
}),
|
|
67
|
-
|
|
63
|
+
IsOptional(),
|
|
68
64
|
__metadata("design:type", String)
|
|
69
65
|
], StripeCheckoutSessionParameters.prototype, "cancelFrontendPath", void 0);
|
|
70
|
-
exports.StripeCheckoutSessionParameters = StripeCheckoutSessionParameters;
|
|
71
66
|
//# sourceMappingURL=StripeCheckoutSessionParams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeCheckoutSessionParams.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionParams.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeCheckoutSessionParams.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionParams.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,0CAA0C;;;;;;;;;;AAE1C,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AACvC,OAAO,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,cAAc,GACjB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,OAAO,sBAAsB;IAE/B,KAAK,CAAU;IAEf,QAAQ,CAAU;CACrB;AAJG;IAAC,WAAW,EAAE;;qDACC;AACf;IAAC,WAAW,EAAE;;wDACI;AAGtB,MAAM,OAAO,+BAA+B;IAGxC,iBAAiB,CAAU;IAM3B,SAAS,CAA4B;IAErC,yGAAyG;IAGzG,IAAI,CAAwC;IAO5C,mBAAmB,CAAU;IAO7B,kBAAkB,CAAU;CAC/B;AA5BG;IAAC,mBAAmB,EAAE;IACrB,UAAU,EAAE;;0EACc;AAE3B;IAAC,WAAW,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,sBAAsB,EAAC,CAAC;IAC1D,OAAO,EAAE;IACT,cAAc,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC;IAC5B,IAAI,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;;kEACE;AAGrC;IAAC,WAAW,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;IAC3B,IAAI,CAAC,CAAC,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;;6DACC;AAE5C;IAAC,WAAW,CAAC;QACT,WAAW,EACP,qJAAqJ;KAC5J,CAAC;IACD,QAAQ,EAAE;;4EACkB;AAE7B;IAAC,mBAAmB,CAAC;QACjB,WAAW,EACP,kKAAkK;KACzK,CAAC;IACD,UAAU,EAAE;;2EACe"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,16 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.StripeCheckoutService = void 0;
|
|
19
13
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
15
|
+
import Stripe from "stripe";
|
|
16
|
+
import CoreLoggerService from "../../logger/CoreLoggerService";
|
|
17
|
+
import { StripeClientConfigurationService } from "../StripeClientConfigurationService";
|
|
24
18
|
let StripeCheckoutService = class StripeCheckoutService {
|
|
25
19
|
logger;
|
|
26
20
|
clientInstance;
|
|
@@ -58,11 +52,11 @@ let StripeCheckoutService = class StripeCheckoutService {
|
|
|
58
52
|
}
|
|
59
53
|
};
|
|
60
54
|
StripeCheckoutService = __decorate([
|
|
61
|
-
|
|
62
|
-
__param(1,
|
|
63
|
-
__metadata("design:paramtypes", [
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
Injectable(),
|
|
56
|
+
__param(1, Inject("StripeClient")),
|
|
57
|
+
__metadata("design:paramtypes", [CoreLoggerService,
|
|
58
|
+
Stripe,
|
|
59
|
+
StripeClientConfigurationService])
|
|
66
60
|
], StripeCheckoutService);
|
|
67
|
-
|
|
61
|
+
export { StripeCheckoutService };
|
|
68
62
|
//# sourceMappingURL=stripe-checkout.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-checkout.service.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-checkout.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stripe-checkout.service.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-checkout.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyD;AACzD,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAC,gCAAgC,EAAC,MAAM,qCAAqC,CAAC;AAG9E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAET;IAEA;IACA;IAJrB,YACqB,MAAyB,EAEzB,cAAsB,EACtB,gCAAkE;QAHlE,WAAM,GAAN,MAAM,CAAmB;QAEzB,mBAAc,GAAd,cAAc,CAAQ;QACtB,qCAAgC,GAAhC,gCAAgC,CAAkC;QAEnF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,2BAA2B,CAAC,UAExC;QACG,0FAA0F;QAC1F,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CACnE;YACI,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,GAAG,IAAI,CAAC,gCAAgC,CAAC,sBAAsB,aAAa;SAC3F,CACJ,CAAC;QAEF,OAAO,OAAO,CAAC,GAAG,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAC9B,UAA2C;QAE3C,MAAM,gBAAgB,GAAG;YACrB,IAAI,EAAE,UAAU,CAAC,IAA2D;YAC5E,mBAAmB,EAAE,UAAU,CAAC,iBAAiB;YACjD,UAAU,EAAE,UAAU,CAAC,SAAS;YAChC,WAAW,EAAE,GAAG,IAAI,CAAC,gCAAgC,CAAC,sBAAsB,GAAG,UAAU,CAAC,mBAAmB,EAAE;YAC/G,UAAU,EAAE,UAAU,CAAC,kBAAkB;gBACrC,CAAC,CAAC,GAAG,IAAI,CAAC,gCAAgC,CAAC,sBAAsB,GAAG,UAAU,CAAC,kBAAkB,EAAE;gBACnG,CAAC,CAAC,SAAS;SACqB,CAAC;QAEzC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAC9D,gBAAgB,CACnB,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACxD;QAED,OAAO,OAAO,CAAC,GAAG,CAAC;IACvB,CAAC;CACJ,CAAA;AAhDY,qBAAqB;IADjC,UAAU,EAAE;IAIJ,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;qCADE,iBAAiB;QAET,MAAM;QACY,gCAAgC;GAL9E,qBAAqB,CAgDjC;SAhDY,qBAAqB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,15 +7,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.StripeEventHandler = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const bull_1 = require("@nestjs/bull");
|
|
18
|
-
const CoreLoggerService_1 = __importDefault(require("../../logger/CoreLoggerService"));
|
|
19
|
-
const stripe_account_module_1 = require("../stripe-account.module");
|
|
10
|
+
import { Injectable } from "@nestjs/common";
|
|
11
|
+
import { OnQueueActive, OnQueueCompleted, OnQueueFailed, Process, Processor, } from "@nestjs/bull";
|
|
12
|
+
import CoreLoggerService from "../../logger/CoreLoggerService";
|
|
13
|
+
import { queueName } from "../stripe-account.module";
|
|
20
14
|
let StripeEventHandler = class StripeEventHandler {
|
|
21
15
|
logger;
|
|
22
16
|
constructor(logger) {
|
|
@@ -109,13 +103,13 @@ let StripeEventHandler = class StripeEventHandler {
|
|
|
109
103
|
}
|
|
110
104
|
};
|
|
111
105
|
__decorate([
|
|
112
|
-
|
|
106
|
+
OnQueueFailed(),
|
|
113
107
|
__metadata("design:type", Function),
|
|
114
108
|
__metadata("design:paramtypes", [Object, Object]),
|
|
115
109
|
__metadata("design:returntype", void 0)
|
|
116
110
|
], StripeEventHandler.prototype, "onError", null);
|
|
117
111
|
__decorate([
|
|
118
|
-
|
|
112
|
+
OnQueueActive()
|
|
119
113
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
120
114
|
,
|
|
121
115
|
__metadata("design:type", Function),
|
|
@@ -123,7 +117,7 @@ __decorate([
|
|
|
123
117
|
__metadata("design:returntype", void 0)
|
|
124
118
|
], StripeEventHandler.prototype, "onActive", null);
|
|
125
119
|
__decorate([
|
|
126
|
-
|
|
120
|
+
OnQueueCompleted()
|
|
127
121
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
128
122
|
,
|
|
129
123
|
__metadata("design:type", Function),
|
|
@@ -131,19 +125,19 @@ __decorate([
|
|
|
131
125
|
__metadata("design:returntype", void 0)
|
|
132
126
|
], StripeEventHandler.prototype, "onComplete", null);
|
|
133
127
|
__decorate([
|
|
134
|
-
|
|
128
|
+
Process(),
|
|
135
129
|
__metadata("design:type", Function),
|
|
136
130
|
__metadata("design:paramtypes", [Object]),
|
|
137
131
|
__metadata("design:returntype", Promise)
|
|
138
132
|
], StripeEventHandler.prototype, "handleEvent", null);
|
|
139
133
|
StripeEventHandler = __decorate([
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
Injectable(),
|
|
135
|
+
Processor(queueName)
|
|
142
136
|
// This should be provided manually to give the consumer ability to change logic
|
|
143
137
|
// it is not part of this modules provided/exported services
|
|
144
138
|
// eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
|
|
145
139
|
,
|
|
146
|
-
__metadata("design:paramtypes", [
|
|
140
|
+
__metadata("design:paramtypes", [CoreLoggerService])
|
|
147
141
|
], StripeEventHandler);
|
|
148
|
-
|
|
142
|
+
export { StripeEventHandler };
|
|
149
143
|
//# sourceMappingURL=stripe-event-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-event-handler.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-event-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stripe-event-handler.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-event-handler.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACH,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,SAAS,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAO5C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACE;IAA7B,YAA6B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAE1D,OAAO,CAAC,GAAsB,EAAE,KAAU;QACtC,IAAI,CAAC,MAAM,CAAC,KAAK;QACb,0KAA0K;QAC1K,cAAc,GAAG,CAAC,EAAE,YAAY,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,OAAc,EAAE;QACnE,sEAAsE;QACtE,KAAK,CAAC,KAAK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C,CAAC;gBAClC,6CAA6C;gBAC7C,OAAO;aACV;YACD,KAAK,+BAA+B,CAAC,CAAC;gBAClC;;;;;mBAKG;gBACH,OAAO;aACV;YAED,OAAO,CAAC,CAAC;gBACL,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,EAAE;oBAClD,SAAS;oBACT,KAAK,EAAE,GAAG,CAAC,IAAI;oBACf,IAAI;iBACP,CAAC,CAAC;aACN;SACJ;IACL,CAAC;CACJ,CAAA;AArGG;IAAC,aAAa,EAAE;;;;iDAQf;AAED;IAAC,aAAa,EAAE;IAChB,0DAA0D;;;;;kDAGzD;AAED;IAAC,gBAAgB,EAAE;IACnB,0DAA0D;;;;;oDAMzD;AAIY;IADZ,OAAO,EAAE;;;;qDA0ET;AAtGQ,kBAAkB;IAL9B,UAAU,EAAE;IACZ,SAAS,CAAC,SAAS,CAAC;IACrB,gFAAgF;IAChF,4DAA4D;IAC5D,iFAAiF;;qCAExC,iBAAiB;GAD7C,kBAAkB,CAuG9B;SAvGY,kBAAkB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,17 +10,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const common_1 = require("@nestjs/common");
|
|
21
|
-
const stripe_1 = __importDefault(require("stripe"));
|
|
22
|
-
const CoreLoggerService_1 = __importDefault(require("../../logger/CoreLoggerService"));
|
|
23
|
-
const stripe_account_module_1 = require("../stripe-account.module");
|
|
24
|
-
const StripeClientConfigurationService_1 = require("../StripeClientConfigurationService");
|
|
13
|
+
import { InjectQueue } from "@nestjs/bull";
|
|
14
|
+
import { BadRequestException, Inject } from "@nestjs/common";
|
|
15
|
+
import Stripe from "stripe";
|
|
16
|
+
import CoreLoggerService from "../../logger/CoreLoggerService";
|
|
17
|
+
import { queueName } from "../stripe-account.module";
|
|
18
|
+
import { StripeClientConfigurationService } from "../StripeClientConfigurationService";
|
|
25
19
|
let StripeWebhookHandler = class StripeWebhookHandler {
|
|
26
20
|
config;
|
|
27
21
|
logger;
|
|
@@ -45,16 +39,16 @@ let StripeWebhookHandler = class StripeWebhookHandler {
|
|
|
45
39
|
}
|
|
46
40
|
catch (error) {
|
|
47
41
|
this.logger.error(`Webhook signature verification failed.`, error);
|
|
48
|
-
throw new
|
|
42
|
+
throw new BadRequestException("Webhook signature verification failed.");
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
45
|
};
|
|
52
46
|
StripeWebhookHandler = __decorate([
|
|
53
|
-
__param(2,
|
|
54
|
-
__param(3,
|
|
55
|
-
__metadata("design:paramtypes", [
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
__param(2, Inject("StripeClient")),
|
|
48
|
+
__param(3, InjectQueue(queueName)),
|
|
49
|
+
__metadata("design:paramtypes", [StripeClientConfigurationService,
|
|
50
|
+
CoreLoggerService,
|
|
51
|
+
Stripe, Object])
|
|
58
52
|
], StripeWebhookHandler);
|
|
59
|
-
|
|
53
|
+
export { StripeWebhookHandler };
|
|
60
54
|
//# sourceMappingURL=stripe-webhook-handler.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-webhook-handler.service.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-webhook-handler.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stripe-webhook-handler.service.js","sourceRoot":"","s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IACL,CAAC;CACJ,CAAA;AAjCY,oBAAoB;IAIxB,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IAEtB,WAAA,WAAW,CAAC,SAAS,CAAC,CAAA;qCAJE,gCAAgC;QAChC,iBAAiB;QAET,MAAM;GALlC,oBAAoB,CAiChC;SAjCY,oBAAoB"}
|
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const core_app_module_1 = require("../root-app/core-app.module");
|
|
20
|
-
const StripeClientProvider_1 = require("./StripeClientProvider");
|
|
21
|
-
const bull_1 = require("@nestjs/bull");
|
|
22
|
-
const stripe_controller_1 = require("./stripe-controller");
|
|
23
|
-
exports.queueName = "stripe-events";
|
|
7
|
+
import { Module } from "@nestjs/common";
|
|
8
|
+
import "reflect-metadata";
|
|
9
|
+
import { StripeClientConfigurationService } from "./StripeClientConfigurationService";
|
|
10
|
+
import { StripeCheckoutService } from "./services/stripe-checkout.service";
|
|
11
|
+
import configVariables from "./StripeConfigurationVariables";
|
|
12
|
+
import { ConfigModule } from "@nestjs/config";
|
|
13
|
+
import { CoreModule } from "../root-app/core-app.module";
|
|
14
|
+
import { StripeClientProvider } from "./StripeClientProvider";
|
|
15
|
+
import { BullModule } from "@nestjs/bull";
|
|
16
|
+
import { StripeClientController } from "./stripe-controller";
|
|
17
|
+
export const queueName = "stripe-events";
|
|
24
18
|
let StripeAccountModule = class StripeAccountModule {
|
|
25
19
|
};
|
|
26
20
|
StripeAccountModule = __decorate([
|
|
27
|
-
|
|
21
|
+
Module({
|
|
28
22
|
imports: [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
name:
|
|
23
|
+
ConfigModule.forFeature(configVariables),
|
|
24
|
+
CoreModule,
|
|
25
|
+
BullModule.registerQueue({
|
|
26
|
+
name: queueName,
|
|
33
27
|
}),
|
|
34
28
|
],
|
|
35
29
|
providers: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
StripeClientProvider,
|
|
31
|
+
StripeClientConfigurationService,
|
|
32
|
+
StripeCheckoutService,
|
|
39
33
|
],
|
|
40
|
-
exports: [
|
|
41
|
-
controllers: [
|
|
34
|
+
exports: [StripeCheckoutService],
|
|
35
|
+
controllers: [StripeClientController],
|
|
42
36
|
})
|
|
43
37
|
], StripeAccountModule);
|
|
44
|
-
|
|
38
|
+
export { StripeAccountModule };
|
|
45
39
|
//# sourceMappingURL=stripe-account.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-account.module.js","sourceRoot":"","sources":["../../src/stripe-client/stripe-account.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stripe-account.module.js","sourceRoot":"","sources":["../../src/stripe-client/stripe-account.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAC,gCAAgC,EAAC,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AACzE,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAE3D,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AAiBlC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,mBAAmB;IAhB/B,MAAM,CAAC;QACJ,OAAO,EAAE;YACL,YAAY,CAAC,UAAU,CAAC,eAAe,CAAC;YACxC,UAAU;YACV,UAAU,CAAC,aAAa,CAAC;gBACrB,IAAI,EAAE,SAAS;aAClB,CAAC;SACL;QACD,SAAS,EAAE;YACP,oBAAoB;YACpB,gCAAgC;YAChC,qBAAqB;SACxB;QACD,OAAO,EAAE,CAAC,qBAAqB,CAAC;QAChC,WAAW,EAAE,CAAC,sBAAsB,CAAC;KACxC,CAAC;GACW,mBAAmB,CAAG;SAAtB,mBAAmB"}
|