@darraghor/nest-backend-libs 2.8.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authz/AccessToken.js +2 -1
- package/dist/authz/AuthConfigurationService.js +15 -12
- package/dist/authz/AuthConfigurationService.js.map +1 -1
- package/dist/authz/AuthConfigurationVariables.js +4 -2
- package/dist/authz/AuthConfigurationVariables.js.map +1 -1
- package/dist/authz/ClaimsAuthorisationGuard.js +13 -7
- package/dist/authz/ClaimsAuthorisationGuard.js.map +1 -1
- package/dist/authz/DefaultAuthGuard.js +8 -5
- package/dist/authz/DefaultAuthGuard.js.map +1 -1
- package/dist/authz/MandatoryUserClaims.decorator.js +6 -2
- package/dist/authz/MandatoryUserClaims.decorator.js.map +1 -1
- package/dist/authz/RequestWithUser.js +2 -1
- package/dist/authz/authz.module.js +23 -17
- package/dist/authz/authz.module.js.map +1 -1
- package/dist/authz/authzstrategy.js +22 -16
- package/dist/authz/authzstrategy.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationService.js +13 -10
- package/dist/authzclient/AuthClientConfigurationService.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationVariables.js +4 -2
- package/dist/authzclient/AuthClientConfigurationVariables.js.map +1 -1
- package/dist/authzclient/AuthzClientProvider.js +8 -5
- package/dist/authzclient/AuthzClientProvider.js.map +1 -1
- package/dist/authzclient/UserProfile.dto.js +5 -1
- package/dist/authzclient/UserProfile.dto.js.map +1 -1
- package/dist/authzclient/authz-client.module.js +19 -13
- package/dist/authzclient/authz-client.module.js.map +1 -1
- package/dist/authzclient/authz.service.js +14 -8
- package/dist/authzclient/authz.service.js.map +1 -1
- package/dist/cli/cli.js +12 -7
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/commands/WriteApiClientCommand.d.ts +3 -0
- package/dist/cli/commands/WriteApiClientCommand.js +24 -7
- package/dist/cli/commands/WriteApiClientCommand.js.map +1 -1
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js +18 -11
- package/dist/cli/commands/WriteTypeOrmConfigCommand.js.map +1 -1
- package/dist/configuration/ValidatedConfigurationService.js +8 -5
- package/dist/configuration/ValidatedConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfig.module.js +15 -9
- package/dist/core-config/CoreConfig.module.js.map +1 -1
- package/dist/core-config/CoreConfigurationService.js +25 -22
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfigurationVariables.js +4 -2
- package/dist/core-config/CoreConfigurationVariables.js.map +1 -1
- package/dist/database-postgres/PostgresDatabase.module.js +14 -11
- package/dist/database-postgres/PostgresDatabase.module.js.map +1 -1
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js +8 -5
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js.map +1 -1
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js +12 -5
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabase.module.js +14 -11
- package/dist/database-sqlite/SqliteDatabase.module.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js +8 -5
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js.map +1 -1
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js +12 -5
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/index.js +64 -30
- package/dist/index.js.map +1 -1
- package/dist/invitations/InvitationConfigurationService.js +13 -10
- package/dist/invitations/InvitationConfigurationService.js.map +1 -1
- package/dist/invitations/InvitationConfigurationVariables.js +4 -2
- package/dist/invitations/InvitationConfigurationVariables.js.map +1 -1
- package/dist/invitations/dto/create-invitation.dto.js +9 -5
- package/dist/invitations/dto/create-invitation.dto.js.map +1 -1
- package/dist/invitations/entities/invitation.entity.js +33 -30
- package/dist/invitations/entities/invitation.entity.js.map +1 -1
- package/dist/invitations/invitation.controller.js +24 -21
- package/dist/invitations/invitation.controller.js.map +1 -1
- package/dist/invitations/invitation.module.js +27 -21
- package/dist/invitations/invitation.module.js.map +1 -1
- package/dist/invitations/invitation.service.js +21 -18
- package/dist/invitations/invitation.service.js.map +1 -1
- package/dist/logger/CoreLoggerService.js +9 -7
- package/dist/logger/CoreLoggerService.js.map +1 -1
- package/dist/logger/LoggingConfigurationService.js +15 -12
- package/dist/logger/LoggingConfigurationService.js.map +1 -1
- package/dist/logger/LoggingConfigurationVariables.js +4 -2
- package/dist/logger/LoggingConfigurationVariables.js.map +1 -1
- package/dist/logger/LoggingInterceptor.js +13 -7
- package/dist/logger/LoggingInterceptor.js.map +1 -1
- package/dist/logger/logger.module.js +20 -14
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/organisation/dto/RolesEnum.js +5 -2
- package/dist/organisation/dto/RolesEnum.js.map +1 -1
- package/dist/organisation/dto/create-organisation.dto.js +11 -7
- package/dist/organisation/dto/create-organisation.dto.js.map +1 -1
- package/dist/organisation/dto/update-organisation.dto.js +7 -3
- package/dist/organisation/dto/update-organisation.dto.js.map +1 -1
- package/dist/organisation/entities/member-role.entity.js +23 -20
- package/dist/organisation/entities/member-role.entity.js.map +1 -1
- package/dist/organisation/entities/organisation-membership.entity.js +40 -37
- package/dist/organisation/entities/organisation-membership.entity.js.map +1 -1
- package/dist/organisation/entities/organisation.entity.js +29 -26
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/organisation/organisation.controller.js +32 -29
- package/dist/organisation/organisation.controller.js.map +1 -1
- package/dist/organisation/organisation.module.js +15 -12
- package/dist/organisation/organisation.module.js.map +1 -1
- package/dist/organisation/organisation.service.js +23 -20
- package/dist/organisation/organisation.service.js.map +1 -1
- package/dist/person/dto/create-person.dto.js +5 -1
- package/dist/person/dto/create-person.dto.js.map +1 -1
- package/dist/person/dto/update-person.dto.js +7 -3
- package/dist/person/dto/update-person.dto.js.map +1 -1
- package/dist/person/entities/person.entity.js +44 -41
- package/dist/person/entities/person.entity.js.map +1 -1
- package/dist/person/person.controller.js +28 -25
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.module.js +18 -15
- package/dist/person/person.module.js.map +1 -1
- package/dist/person/person.service.js +28 -22
- package/dist/person/person.service.js.map +1 -1
- package/dist/root-app/SwaggerGen.js +21 -15
- package/dist/root-app/SwaggerGen.js.map +1 -1
- package/dist/root-app/app.controller.js +23 -17
- package/dist/root-app/app.controller.js.map +1 -1
- package/dist/root-app/app.service.js +6 -3
- package/dist/root-app/app.service.js.map +1 -1
- package/dist/root-app/core-app.module.js +32 -26
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/root-app/notfound.interceptor.js +9 -6
- package/dist/root-app/notfound.interceptor.js.map +1 -1
- package/dist/runningCommandLine/CliCommandService.js +14 -8
- package/dist/runningCommandLine/CliCommandService.js.map +1 -1
- package/dist/runningCommandLine/RunningCommandLine.module.js +12 -9
- package/dist/runningCommandLine/RunningCommandLine.module.js.map +1 -1
- package/dist/smtp-email-client/EmailClientProvider.js +8 -5
- package/dist/smtp-email-client/EmailClientProvider.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.js +27 -24
- package/dist/smtp-email-client/EmailConfigurationService.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.js +4 -2
- package/dist/smtp-email-client/EmailConfigurationVariables.js.map +1 -1
- package/dist/smtp-email-client/email-client.service.js +21 -15
- package/dist/smtp-email-client/email-client.service.js.map +1 -1
- package/dist/smtp-email-client/email.controller.js +15 -12
- package/dist/smtp-email-client/email.controller.js.map +1 -1
- package/dist/smtp-email-client/email.entity.js +35 -32
- package/dist/smtp-email-client/email.entity.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.js +32 -26
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-handler.js +21 -15
- package/dist/smtp-email-client/smtp-email-handler.js.map +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.js +17 -14
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/StripeClientProvider.js +11 -5
- package/dist/stripe-client/StripeClientProvider.js.map +1 -1
- package/dist/stripe-client/StripeConfigurationVariables.js +4 -2
- package/dist/stripe-client/StripeConfigurationVariables.js.map +1 -1
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js +24 -19
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js.map +1 -1
- package/dist/stripe-client/services/stripe-checkout.service.js +16 -10
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/services/stripe-event-handler.js +18 -12
- package/dist/stripe-client/services/stripe-event-handler.js.map +1 -1
- package/dist/stripe-client/services/stripe-webhook-handler.service.js +19 -13
- package/dist/stripe-client/services/stripe-webhook-handler.service.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.js +28 -22
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-controller.js +30 -27
- package/dist/stripe-client/stripe-controller.js.map +1 -1
- package/dist/testing/preRun.js +3 -1
- package/dist/testing/preRun.js.map +1 -1
- package/dist/twitter-client/TwitterClientConfigurationService.js +19 -16
- package/dist/twitter-client/TwitterClientConfigurationService.js.map +1 -1
- package/dist/twitter-client/TwitterClientProvider.js +8 -5
- package/dist/twitter-client/TwitterClientProvider.js.map +1 -1
- package/dist/twitter-client/TwitterConfigurationVariables.js +4 -2
- package/dist/twitter-client/TwitterConfigurationVariables.js.map +1 -1
- package/dist/twitter-client/services/twitter-client.service.js +14 -8
- package/dist/twitter-client/services/twitter-client.service.js.map +1 -1
- package/dist/twitter-client/twitter-account.module.js +21 -15
- package/dist/twitter-client/twitter-account.module.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7,12 +8,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SmtpEmailHandler = void 0;
|
|
16
|
+
const bull_1 = require("@nestjs/bull");
|
|
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");
|
|
16
22
|
let SmtpEmailHandler = class SmtpEmailHandler {
|
|
17
23
|
config;
|
|
18
24
|
emailRepository;
|
|
@@ -69,13 +75,13 @@ let SmtpEmailHandler = class SmtpEmailHandler {
|
|
|
69
75
|
}
|
|
70
76
|
};
|
|
71
77
|
__decorate([
|
|
72
|
-
OnQueueFailed(),
|
|
78
|
+
(0, bull_1.OnQueueFailed)(),
|
|
73
79
|
__metadata("design:type", Function),
|
|
74
80
|
__metadata("design:paramtypes", [Object, Object]),
|
|
75
81
|
__metadata("design:returntype", void 0)
|
|
76
82
|
], SmtpEmailHandler.prototype, "onError", null);
|
|
77
83
|
__decorate([
|
|
78
|
-
OnQueueActive()
|
|
84
|
+
(0, bull_1.OnQueueActive)()
|
|
79
85
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
80
86
|
,
|
|
81
87
|
__metadata("design:type", Function),
|
|
@@ -83,7 +89,7 @@ __decorate([
|
|
|
83
89
|
__metadata("design:returntype", void 0)
|
|
84
90
|
], SmtpEmailHandler.prototype, "onActive", null);
|
|
85
91
|
__decorate([
|
|
86
|
-
OnQueueCompleted()
|
|
92
|
+
(0, bull_1.OnQueueCompleted)()
|
|
87
93
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
88
94
|
,
|
|
89
95
|
__metadata("design:type", Function),
|
|
@@ -91,16 +97,16 @@ __decorate([
|
|
|
91
97
|
__metadata("design:returntype", void 0)
|
|
92
98
|
], SmtpEmailHandler.prototype, "onComplete", null);
|
|
93
99
|
__decorate([
|
|
94
|
-
Process(),
|
|
100
|
+
(0, bull_1.Process)(),
|
|
95
101
|
__metadata("design:type", Function),
|
|
96
102
|
__metadata("design:paramtypes", [Object]),
|
|
97
103
|
__metadata("design:returntype", Promise)
|
|
98
104
|
], SmtpEmailHandler.prototype, "handleEvent", null);
|
|
99
105
|
SmtpEmailHandler = __decorate([
|
|
100
|
-
Injectable(),
|
|
101
|
-
Processor(queueName),
|
|
102
|
-
__metadata("design:paramtypes", [EmailConfigurationService,
|
|
103
|
-
Repository, Object,
|
|
106
|
+
(0, common_1.Injectable)(),
|
|
107
|
+
(0, bull_1.Processor)(smtp_email_client_module_1.queueName),
|
|
108
|
+
__metadata("design:paramtypes", [EmailConfigurationService_1.EmailConfigurationService,
|
|
109
|
+
typeorm_1.Repository, Object, CoreLoggerService_1.default])
|
|
104
110
|
], SmtpEmailHandler);
|
|
105
|
-
|
|
111
|
+
exports.SmtpEmailHandler = SmtpEmailHandler;
|
|
106
112
|
//# 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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F5B,IAAA,mBAAU,GAAE;IACZ,IAAA,gBAAS,EAAC,oCAAS,CAAC;qCAGG,qDAAyB;QAChB,oBAAU,UAEV,2BAAiB;GALrC,gBAAgB,CAoE5B;AApEY,4CAAgB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7,12 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StripeClientConfigurationService = void 0;
|
|
10
13
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let StripeClientConfigurationService = class StripeClientConfigurationService extends ValidatedConfigurationService {
|
|
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 StripeClientConfigurationService = class StripeClientConfigurationService extends ValidatedConfigurationService_1.ValidatedConfigurationService {
|
|
16
19
|
configService;
|
|
17
20
|
constructor(configService) {
|
|
18
21
|
super();
|
|
@@ -29,26 +32,26 @@ let StripeClientConfigurationService = class StripeClientConfigurationService ex
|
|
|
29
32
|
}
|
|
30
33
|
};
|
|
31
34
|
__decorate([
|
|
32
|
-
IsDefined(),
|
|
33
|
-
IsString(),
|
|
35
|
+
(0, class_validator_1.IsDefined)(),
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
34
37
|
__metadata("design:type", String),
|
|
35
38
|
__metadata("design:paramtypes", [])
|
|
36
39
|
], StripeClientConfigurationService.prototype, "accessToken", null);
|
|
37
40
|
__decorate([
|
|
38
|
-
IsDefined(),
|
|
39
|
-
IsString(),
|
|
41
|
+
(0, class_validator_1.IsDefined)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
40
43
|
__metadata("design:type", String),
|
|
41
44
|
__metadata("design:paramtypes", [])
|
|
42
45
|
], StripeClientConfigurationService.prototype, "webhookVerificationKey", null);
|
|
43
46
|
__decorate([
|
|
44
|
-
IsDefined(),
|
|
45
|
-
IsString(),
|
|
47
|
+
(0, class_validator_1.IsDefined)(),
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
46
49
|
__metadata("design:type", String),
|
|
47
50
|
__metadata("design:paramtypes", [])
|
|
48
51
|
], StripeClientConfigurationService.prototype, "stripeRedirectsBaseUrl", null);
|
|
49
52
|
StripeClientConfigurationService = __decorate([
|
|
50
|
-
Injectable(),
|
|
51
|
-
__metadata("design:paramtypes", [ConfigService])
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
52
55
|
], StripeClientConfigurationService);
|
|
53
|
-
|
|
56
|
+
exports.StripeClientConfigurationService = StripeClientConfigurationService;
|
|
54
57
|
//# 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,2CAA0C;AAC1C,2CAA6C;AAC7C,qDAAoD;AACpD,kGAA6F;AAGtF,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,6DAA6B;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,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;mEAGV;AAED;IAAC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;8EAKV;AAED;IAAC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;8EAKV;AAzBQ,gCAAgC;IAD5C,IAAA,mBAAU,GAAE;qCAE0B,sBAAa;GADvC,gCAAgC,CA0B5C;AA1BY,4EAAgC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
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 = {
|
|
4
10
|
provide: "StripeClient",
|
|
5
11
|
useFactory: (config) => {
|
|
6
12
|
const apiVersion = "2022-11-15";
|
|
@@ -9,8 +15,8 @@ export const StripeClientProvider = {
|
|
|
9
15
|
url: "https://github.com/darraghoriordan/nest-backend-libs", // Optional
|
|
10
16
|
};
|
|
11
17
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
|
|
12
|
-
return new
|
|
18
|
+
return new stripe_1.default(config.accessToken, { apiVersion, appInfo });
|
|
13
19
|
},
|
|
14
|
-
inject: [StripeClientConfigurationService],
|
|
20
|
+
inject: [StripeClientConfigurationService_1.StripeClientConfigurationService],
|
|
15
21
|
};
|
|
16
22
|
//# sourceMappingURL=StripeClientProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeClientProvider.js","sourceRoot":"","sources":["../../src/stripe-client/StripeClientProvider.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"StripeClientProvider.js","sourceRoot":"","sources":["../../src/stripe-client/StripeClientProvider.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,yFAAoF;AAEvE,QAAA,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,gBAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAC,UAAU,EAAE,OAAO,EAAC,CAAC,CAAC;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,mEAAgC,CAAC;CAC7C,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_1 = require("@nestjs/config");
|
|
4
|
+
exports.default = (0, config_1.registerAs)("stripe-client", () => ({
|
|
3
5
|
accessToken: process.env.STRIPE_ACCESS_TOKEN,
|
|
4
6
|
webhookVerificationKey: process.env.STRIPE_WEBHOOK_VERIFICATION_KEY,
|
|
5
7
|
stripeRedirectsBaseUrl: process.env.STRIPE_REDIRECTS_BASE_URL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeConfigurationVariables.js","sourceRoot":"","sources":["../../src/stripe-client/StripeConfigurationVariables.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"StripeConfigurationVariables.js","sourceRoot":"","sources":["../../src/stripe-client/StripeConfigurationVariables.ts"],"names":[],"mappings":";;AAAA,2CAA0C;AAE1C,kBAAe,IAAA,mBAAU,EAAC,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,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// this just exists to avoid having to import the stripe lib directly
|
|
2
3
|
// not sure if a great idea but let's see!
|
|
3
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -9,22 +10,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
9
10
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
11
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.StripeCheckoutSessionParameters = exports.StripeCheckoutLineItem = void 0;
|
|
15
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
16
|
+
const class_transformer_1 = require("class-transformer");
|
|
17
|
+
const class_validator_1 = require("class-validator");
|
|
18
|
+
class StripeCheckoutLineItem {
|
|
16
19
|
price;
|
|
17
20
|
quantity;
|
|
18
21
|
}
|
|
19
22
|
__decorate([
|
|
20
|
-
ApiProperty(),
|
|
23
|
+
(0, swagger_1.ApiProperty)(),
|
|
21
24
|
__metadata("design:type", String)
|
|
22
25
|
], StripeCheckoutLineItem.prototype, "price", void 0);
|
|
23
26
|
__decorate([
|
|
24
|
-
ApiProperty(),
|
|
27
|
+
(0, swagger_1.ApiProperty)(),
|
|
25
28
|
__metadata("design:type", Number)
|
|
26
29
|
], StripeCheckoutLineItem.prototype, "quantity", void 0);
|
|
27
|
-
|
|
30
|
+
exports.StripeCheckoutLineItem = StripeCheckoutLineItem;
|
|
31
|
+
class StripeCheckoutSessionParameters {
|
|
28
32
|
clientReferenceId;
|
|
29
33
|
lineItems;
|
|
30
34
|
// eslint-disable-next-line @darraghor/nestjs-typed/validated-non-primitive-property-needs-type-decorator
|
|
@@ -33,34 +37,35 @@ export class StripeCheckoutSessionParameters {
|
|
|
33
37
|
cancelFrontendPath;
|
|
34
38
|
}
|
|
35
39
|
__decorate([
|
|
36
|
-
ApiPropertyOptional(),
|
|
37
|
-
IsOptional(),
|
|
40
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
42
|
__metadata("design:type", String)
|
|
39
43
|
], StripeCheckoutSessionParameters.prototype, "clientReferenceId", void 0);
|
|
40
44
|
__decorate([
|
|
41
|
-
ApiProperty({ isArray: true, type: StripeCheckoutLineItem }),
|
|
42
|
-
IsArray(),
|
|
43
|
-
ValidateNested({ each: true }),
|
|
44
|
-
Type(() => StripeCheckoutLineItem),
|
|
45
|
+
(0, swagger_1.ApiProperty)({ isArray: true, type: StripeCheckoutLineItem }),
|
|
46
|
+
(0, class_validator_1.IsArray)(),
|
|
47
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
48
|
+
(0, class_transformer_1.Type)(() => StripeCheckoutLineItem),
|
|
45
49
|
__metadata("design:type", Array)
|
|
46
50
|
], StripeCheckoutSessionParameters.prototype, "lineItems", void 0);
|
|
47
51
|
__decorate([
|
|
48
|
-
ApiProperty({ type: String }),
|
|
49
|
-
IsIn(["subscription", "payment", "setup"]),
|
|
52
|
+
(0, swagger_1.ApiProperty)({ type: String }),
|
|
53
|
+
(0, class_validator_1.IsIn)(["subscription", "payment", "setup"]),
|
|
50
54
|
__metadata("design:type", String)
|
|
51
55
|
], StripeCheckoutSessionParameters.prototype, "mode", void 0);
|
|
52
56
|
__decorate([
|
|
53
|
-
ApiProperty({
|
|
57
|
+
(0, swagger_1.ApiProperty)({
|
|
54
58
|
description: "The URL to which Stripe should redirect the customer after payment. This is appended to the host configured in the StripeClientConfigurationService",
|
|
55
59
|
}),
|
|
56
|
-
IsString(),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
57
61
|
__metadata("design:type", String)
|
|
58
62
|
], StripeCheckoutSessionParameters.prototype, "successFrontendPath", void 0);
|
|
59
63
|
__decorate([
|
|
60
|
-
ApiPropertyOptional({
|
|
64
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
61
65
|
description: "The URL to which Stripe should redirect the customer after payment cancellation. This is appended to the host configured in the StripeClientConfigurationService",
|
|
62
66
|
}),
|
|
63
|
-
IsOptional(),
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
64
68
|
__metadata("design:type", String)
|
|
65
69
|
], StripeCheckoutSessionParameters.prototype, "cancelFrontendPath", void 0);
|
|
70
|
+
exports.StripeCheckoutSessionParameters = StripeCheckoutSessionParameters;
|
|
66
71
|
//# sourceMappingURL=StripeCheckoutSessionParams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeCheckoutSessionParams.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionParams.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,0CAA0C
|
|
1
|
+
{"version":3,"file":"StripeCheckoutSessionParams.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionParams.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,0CAA0C;;;;;;;;;;;;AAE1C,6CAAiE;AACjE,yDAAuC;AACvC,qDAMyB;AAEzB,MAAa,sBAAsB;IAE/B,KAAK,CAAU;IAEf,QAAQ,CAAU;CACrB;AAJG;IAAC,IAAA,qBAAW,GAAE;;qDACC;AACf;IAAC,IAAA,qBAAW,GAAE;;wDACI;AAJtB,wDAKC;AAED,MAAa,+BAA+B;IAGxC,iBAAiB,CAAU;IAM3B,SAAS,CAA4B;IAErC,yGAAyG;IAGzG,IAAI,CAAwC;IAO5C,mBAAmB,CAAU;IAO7B,kBAAkB,CAAU;CAC/B;AA5BG;IAAC,IAAA,6BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;0EACc;AAE3B;IAAC,IAAA,qBAAW,EAAC,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,sBAAsB,EAAC,CAAC;IAC1D,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC;IAC5B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;;kEACE;AAGrC;IAAC,IAAA,qBAAW,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;IAC3B,IAAA,sBAAI,EAAC,CAAC,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;;6DACC;AAE5C;IAAC,IAAA,qBAAW,EAAC;QACT,WAAW,EACP,qJAAqJ;KAC5J,CAAC;IACD,IAAA,0BAAQ,GAAE;;4EACkB;AAE7B;IAAC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EACP,kKAAkK;KACzK,CAAC;IACD,IAAA,4BAAU,GAAE;;2EACe;AA5BhC,0EA6BC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -10,11 +11,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
13
|
};
|
|
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;
|
|
13
19
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
const common_1 = require("@nestjs/common");
|
|
21
|
+
const stripe_1 = __importDefault(require("stripe"));
|
|
22
|
+
const CoreLoggerService_1 = __importDefault(require("../../logger/CoreLoggerService"));
|
|
23
|
+
const StripeClientConfigurationService_1 = require("../StripeClientConfigurationService");
|
|
18
24
|
let StripeCheckoutService = class StripeCheckoutService {
|
|
19
25
|
logger;
|
|
20
26
|
clientInstance;
|
|
@@ -52,11 +58,11 @@ let StripeCheckoutService = class StripeCheckoutService {
|
|
|
52
58
|
}
|
|
53
59
|
};
|
|
54
60
|
StripeCheckoutService = __decorate([
|
|
55
|
-
Injectable(),
|
|
56
|
-
__param(1, Inject("StripeClient")),
|
|
57
|
-
__metadata("design:paramtypes", [
|
|
58
|
-
|
|
59
|
-
StripeClientConfigurationService])
|
|
61
|
+
(0, common_1.Injectable)(),
|
|
62
|
+
__param(1, (0, common_1.Inject)("StripeClient")),
|
|
63
|
+
__metadata("design:paramtypes", [CoreLoggerService_1.default,
|
|
64
|
+
stripe_1.default,
|
|
65
|
+
StripeClientConfigurationService_1.StripeClientConfigurationService])
|
|
60
66
|
], StripeCheckoutService);
|
|
61
|
-
|
|
67
|
+
exports.StripeCheckoutService = StripeCheckoutService;
|
|
62
68
|
//# 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,2CAAkD;AAClD,oDAA4B;AAC5B,uFAA+D;AAG/D,0FAAqF;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,IAAA,mBAAU,GAAE;IAIJ,WAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;qCADE,2BAAiB;QAET,gBAAM;QACY,mEAAgC;GAL9E,qBAAqB,CAgDjC;AAhDY,sDAAqB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7,10 +8,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.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");
|
|
14
20
|
let StripeEventHandler = class StripeEventHandler {
|
|
15
21
|
logger;
|
|
16
22
|
constructor(logger) {
|
|
@@ -103,13 +109,13 @@ let StripeEventHandler = class StripeEventHandler {
|
|
|
103
109
|
}
|
|
104
110
|
};
|
|
105
111
|
__decorate([
|
|
106
|
-
OnQueueFailed(),
|
|
112
|
+
(0, bull_1.OnQueueFailed)(),
|
|
107
113
|
__metadata("design:type", Function),
|
|
108
114
|
__metadata("design:paramtypes", [Object, Object]),
|
|
109
115
|
__metadata("design:returntype", void 0)
|
|
110
116
|
], StripeEventHandler.prototype, "onError", null);
|
|
111
117
|
__decorate([
|
|
112
|
-
OnQueueActive()
|
|
118
|
+
(0, bull_1.OnQueueActive)()
|
|
113
119
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
114
120
|
,
|
|
115
121
|
__metadata("design:type", Function),
|
|
@@ -117,7 +123,7 @@ __decorate([
|
|
|
117
123
|
__metadata("design:returntype", void 0)
|
|
118
124
|
], StripeEventHandler.prototype, "onActive", null);
|
|
119
125
|
__decorate([
|
|
120
|
-
OnQueueCompleted()
|
|
126
|
+
(0, bull_1.OnQueueCompleted)()
|
|
121
127
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
122
128
|
,
|
|
123
129
|
__metadata("design:type", Function),
|
|
@@ -125,19 +131,19 @@ __decorate([
|
|
|
125
131
|
__metadata("design:returntype", void 0)
|
|
126
132
|
], StripeEventHandler.prototype, "onComplete", null);
|
|
127
133
|
__decorate([
|
|
128
|
-
Process(),
|
|
134
|
+
(0, bull_1.Process)(),
|
|
129
135
|
__metadata("design:type", Function),
|
|
130
136
|
__metadata("design:paramtypes", [Object]),
|
|
131
137
|
__metadata("design:returntype", Promise)
|
|
132
138
|
], StripeEventHandler.prototype, "handleEvent", null);
|
|
133
139
|
StripeEventHandler = __decorate([
|
|
134
|
-
Injectable(),
|
|
135
|
-
Processor(queueName)
|
|
140
|
+
(0, common_1.Injectable)(),
|
|
141
|
+
(0, bull_1.Processor)(stripe_account_module_1.queueName)
|
|
136
142
|
// This should be provided manually to give the consumer ability to change logic
|
|
137
143
|
// it is not part of this modules provided/exported services
|
|
138
144
|
// eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
|
|
139
145
|
,
|
|
140
|
-
__metadata("design:paramtypes", [
|
|
146
|
+
__metadata("design:paramtypes", [CoreLoggerService_1.default])
|
|
141
147
|
], StripeEventHandler);
|
|
142
|
-
|
|
148
|
+
exports.StripeEventHandler = StripeEventHandler;
|
|
143
149
|
//# 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,2CAA0C;AAC1C,uCAMsB;AAEtB,uFAA+D;AAE/D,oEAAmD;AAO5C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACE;IAA7B,YAA6B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAE1D,OAAO,CAAC,GAAsB,EAAE,KAAU;QACtC,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,CAAC;gBAC3B,2EAA2E;gBAC3E,+EAA+E;gBAC/E,uDAAuD;gBACvD,OAAO;aACV;YACD,KAAK,+BAA+B,CAAC,CAAC;gBAClC;;;;;;kBAME;gBACF,OAAO;aACV;YACD,KAAK,+BAA+B,CAAC,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,IAAA,oBAAa,GAAE;;;;iDAQf;AAED;IAAC,IAAA,oBAAa,GAAE;IAChB,0DAA0D;;;;;kDAGzD;AAED;IAAC,IAAA,uBAAgB,GAAE;IACnB,0DAA0D;;;;;oDAMzD;AAIY;IADZ,IAAA,cAAO,GAAE;;;;qDA0ET;AAtGQ,kBAAkB;IAL9B,IAAA,mBAAU,GAAE;IACZ,IAAA,gBAAS,EAAC,iCAAS,CAAC;IACrB,gFAAgF;IAChF,4DAA4D;IAC5D,iFAAiF;;qCAExC,2BAAiB;GAD7C,kBAAkB,CAuG9B;AAvGY,gDAAkB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -10,12 +11,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
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.StripeWebhookHandler = void 0;
|
|
19
|
+
const bull_1 = require("@nestjs/bull");
|
|
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");
|
|
19
25
|
let StripeWebhookHandler = class StripeWebhookHandler {
|
|
20
26
|
config;
|
|
21
27
|
logger;
|
|
@@ -39,16 +45,16 @@ let StripeWebhookHandler = class StripeWebhookHandler {
|
|
|
39
45
|
}
|
|
40
46
|
catch (error) {
|
|
41
47
|
this.logger.error(`Webhook signature verification failed.`, error);
|
|
42
|
-
throw new BadRequestException("Webhook signature verification failed.");
|
|
48
|
+
throw new common_1.BadRequestException("Webhook signature verification failed.");
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
51
|
};
|
|
46
52
|
StripeWebhookHandler = __decorate([
|
|
47
|
-
__param(2, Inject("StripeClient")),
|
|
48
|
-
__param(3, InjectQueue(queueName)),
|
|
49
|
-
__metadata("design:paramtypes", [StripeClientConfigurationService,
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
__param(2, (0, common_1.Inject)("StripeClient")),
|
|
54
|
+
__param(3, (0, bull_1.InjectQueue)(stripe_account_module_1.queueName)),
|
|
55
|
+
__metadata("design:paramtypes", [StripeClientConfigurationService_1.StripeClientConfigurationService,
|
|
56
|
+
CoreLoggerService_1.default,
|
|
57
|
+
stripe_1.default, Object])
|
|
52
58
|
], StripeWebhookHandler);
|
|
53
|
-
|
|
59
|
+
exports.StripeWebhookHandler = StripeWebhookHandler;
|
|
54
60
|
//# 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":"","sources":["../../../src/stripe-client/services/stripe-webhook-handler.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAyC;AACzC,2CAA2E;AAG3E,oDAA4B;AAC5B,uFAA+D;AAC/D,oEAAmD;AACnD,0FAAqF;AAE9E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAER;IACA;IAEA;IACe;IALpC,YACqB,MAAwC,EACxC,MAAyB,EAEzB,cAAsB,EACP,KAAY;QAJ3B,WAAM,GAAN,MAAM,CAAkC;QACxC,WAAM,GAAN,MAAM,CAAmB;QAEzB,mBAAc,GAAd,cAAc,CAAQ;QACP,UAAK,GAAL,KAAK,CAAO;IAC7C,CAAC;IAEG,KAAK,CAAC,aAAa,CACtB,OAAgC;QAEhC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEtD,IAAI,CAAC,SAAS,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;SACnE;QAED,IAAI;YACA,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,cAAc,CACrD,OAAO,CAAC,IAAc,EAAE,qCAAqC;YAC7D,SAAS,EACT,IAAI,CAAC,MAAM,CAAC,sBAAsB,CACrC,CAAC;YAEF,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC/B;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;YACnE,MAAM,IAAI,4BAAmB,CACzB,wCAAwC,CAC3C,CAAC;SACL;IACL,CAAC;CACJ,CAAA;AAjCY,oBAAoB;IAIxB,WAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;IAEtB,WAAA,IAAA,kBAAW,EAAC,iCAAS,CAAC,CAAA;qCAJE,mEAAgC;QAChC,2BAAiB;QAET,gBAAM;GALlC,oBAAoB,CAiChC;AAjCY,oDAAoB"}
|
|
@@ -1,39 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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.StripeAccountModule = exports.queueName = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
require("reflect-metadata");
|
|
15
|
+
const StripeClientConfigurationService_1 = require("./StripeClientConfigurationService");
|
|
16
|
+
const stripe_checkout_service_1 = require("./services/stripe-checkout.service");
|
|
17
|
+
const StripeConfigurationVariables_1 = __importDefault(require("./StripeConfigurationVariables"));
|
|
18
|
+
const config_1 = require("@nestjs/config");
|
|
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";
|
|
18
24
|
let StripeAccountModule = class StripeAccountModule {
|
|
19
25
|
};
|
|
20
26
|
StripeAccountModule = __decorate([
|
|
21
|
-
Module({
|
|
27
|
+
(0, common_1.Module)({
|
|
22
28
|
imports: [
|
|
23
|
-
ConfigModule.forFeature(
|
|
24
|
-
CoreModule,
|
|
25
|
-
BullModule.registerQueue({
|
|
26
|
-
name: queueName,
|
|
29
|
+
config_1.ConfigModule.forFeature(StripeConfigurationVariables_1.default),
|
|
30
|
+
core_app_module_1.CoreModule,
|
|
31
|
+
bull_1.BullModule.registerQueue({
|
|
32
|
+
name: exports.queueName,
|
|
27
33
|
}),
|
|
28
34
|
],
|
|
29
35
|
providers: [
|
|
30
|
-
StripeClientProvider,
|
|
31
|
-
StripeClientConfigurationService,
|
|
32
|
-
StripeCheckoutService,
|
|
36
|
+
StripeClientProvider_1.StripeClientProvider,
|
|
37
|
+
StripeClientConfigurationService_1.StripeClientConfigurationService,
|
|
38
|
+
stripe_checkout_service_1.StripeCheckoutService,
|
|
33
39
|
],
|
|
34
|
-
exports: [StripeCheckoutService],
|
|
35
|
-
controllers: [StripeClientController],
|
|
40
|
+
exports: [stripe_checkout_service_1.StripeCheckoutService],
|
|
41
|
+
controllers: [stripe_controller_1.StripeClientController],
|
|
36
42
|
})
|
|
37
43
|
], StripeAccountModule);
|
|
38
|
-
|
|
44
|
+
exports.StripeAccountModule = StripeAccountModule;
|
|
39
45
|
//# 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,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"}
|