@darraghor/nest-backend-libs 1.49.0 → 2.0.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/authzstrategy.js +2 -2
- package/dist/authz/authzstrategy.js.map +1 -1
- package/dist/core-config/CoreConfigurationService.d.ts +1 -2
- package/dist/core-config/CoreConfigurationService.js +3 -12
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfigurationVariables.d.ts +2 -4
- package/dist/core-config/CoreConfigurationVariables.js +1 -2
- package/dist/core-config/CoreConfigurationVariables.js.map +1 -1
- package/dist/database-postgres/PostgresDatabaseConfigurationService.d.ts +0 -2
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js +0 -2
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js.map +1 -1
- package/dist/organisation/dto/RolesEnum.d.ts +4 -0
- package/dist/organisation/dto/RolesEnum.js +10 -0
- package/dist/organisation/dto/RolesEnum.js.map +1 -0
- package/dist/organisation/entities/member-role.entity.d.ts +10 -0
- package/dist/organisation/entities/member-role.entity.js +60 -0
- package/dist/organisation/entities/member-role.entity.js.map +1 -0
- package/dist/organisation/entities/organisation-membership.entity.d.ts +16 -0
- package/dist/organisation/entities/organisation-membership.entity.js +105 -0
- package/dist/organisation/entities/organisation-membership.entity.js.map +1 -0
- package/dist/organisation/entities/organisation.entity.d.ts +2 -4
- package/dist/organisation/entities/organisation.entity.js +7 -23
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/organisation/organisation.service.js +73 -17
- package/dist/organisation/organisation.service.js.map +1 -1
- package/dist/person/entities/person.entity.d.ts +2 -3
- package/dist/person/entities/person.entity.js +6 -17
- package/dist/person/entities/person.entity.js.map +1 -1
- package/dist/person/person.service.js +33 -11
- package/dist/person/person.service.js.map +1 -1
- package/dist/root-app/core-app.module.js +4 -2
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.d.ts +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.js +3 -3
- package/dist/smtp-email-client/EmailConfigurationService.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.d.ts +2 -2
- package/dist/smtp-email-client/EmailConfigurationVariables.js +1 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.js.map +1 -1
- package/dist/smtp-email-client/email-client.service.d.ts +4 -2
- package/dist/smtp-email-client/email-client.service.js +20 -26
- package/dist/smtp-email-client/email-client.service.js.map +1 -1
- package/dist/smtp-email-client/email.entity.d.ts +3 -1
- package/dist/smtp-email-client/email.entity.js +12 -2
- package/dist/smtp-email-client/email.entity.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.d.ts +1 -0
- package/dist/smtp-email-client/smtp-email-client.module.js +8 -1
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-handler.d.ts +17 -0
- package/dist/smtp-email-client/smtp-email-handler.js +108 -0
- package/dist/smtp-email-client/smtp-email-handler.js.map +1 -0
- package/dist/stripe-client/StripeClientConfigurationService.d.ts +9 -0
- package/dist/stripe-client/StripeClientConfigurationService.js +56 -0
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -0
- package/dist/stripe-client/StripeClientProvider.d.ts +7 -0
- package/dist/stripe-client/StripeClientProvider.js +22 -0
- package/dist/stripe-client/StripeClientProvider.js.map +1 -0
- package/dist/stripe-client/StripeConfigurationVariables.d.ts +10 -0
- package/dist/stripe-client/StripeConfigurationVariables.js +9 -0
- package/dist/stripe-client/StripeConfigurationVariables.js.map +1 -0
- package/dist/stripe-client/models/StripeCheckoutSessionParams.d.ts +11 -0
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js +63 -0
- package/dist/stripe-client/models/StripeCheckoutSessionParams.js.map +1 -0
- package/dist/stripe-client/services/stripe-checkout.service.d.ts +15 -0
- package/dist/stripe-client/services/stripe-checkout.service.js +65 -0
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -0
- package/dist/stripe-client/services/stripe-event-handler.d.ts +11 -0
- package/dist/stripe-client/services/stripe-event-handler.js +148 -0
- package/dist/stripe-client/services/stripe-event-handler.js.map +1 -0
- package/dist/stripe-client/services/stripe-webhook-handler.service.d.ts +14 -0
- package/dist/stripe-client/services/stripe-webhook-handler.service.js +56 -0
- package/dist/stripe-client/services/stripe-webhook-handler.service.js.map +1 -0
- package/dist/stripe-client/stripe-account.module.d.ts +4 -0
- package/dist/stripe-client/stripe-account.module.js +44 -0
- package/dist/stripe-client/stripe-account.module.js.map +1 -0
- package/dist/stripe-client/stripe-controller.d.ts +14 -0
- package/dist/stripe-client/stripe-controller.js +86 -0
- package/dist/stripe-client/stripe-controller.js.map +1 -0
- package/package.json +20 -17
|
@@ -0,0 +1,86 @@
|
|
|
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.OrganisationController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const passport_1 = require("@nestjs/passport");
|
|
18
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
+
const StripeCheckoutSessionParams_1 = require("./models/StripeCheckoutSessionParams");
|
|
20
|
+
const stripe_checkout_service_1 = require("./services/stripe-checkout.service");
|
|
21
|
+
const stripe_webhook_handler_service_1 = require("./services/stripe-webhook-handler.service");
|
|
22
|
+
let OrganisationController = class OrganisationController {
|
|
23
|
+
constructor(stripeService, stripeWebhookService) {
|
|
24
|
+
this.stripeService = stripeService;
|
|
25
|
+
this.stripeWebhookService = stripeWebhookService;
|
|
26
|
+
}
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unicorn/prevent-abbreviations
|
|
29
|
+
async webhookReceiver(req) {
|
|
30
|
+
return this.stripeWebhookService.handleWebhook(req);
|
|
31
|
+
}
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
|
+
async createCustomerPortalSession(request) {
|
|
34
|
+
return this.stripeService.createCustomerPortalSession({
|
|
35
|
+
user: request.user,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
|
+
async createCheckoutSession(request, createSessionDto) {
|
|
40
|
+
return this.stripeService.createCheckoutSession(createSessionDto);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, common_1.Post)("webhook-receiver"),
|
|
45
|
+
(0, swagger_1.ApiOkResponse)(),
|
|
46
|
+
(0, swagger_1.ApiBadRequestResponse)()
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unicorn/prevent-abbreviations
|
|
48
|
+
,
|
|
49
|
+
__param(0, (0, common_1.Req)()),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [Object]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], OrganisationController.prototype, "webhookReceiver", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
|
|
56
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
57
|
+
(0, common_1.Post)("customer-portal-session"),
|
|
58
|
+
(0, swagger_1.ApiOkResponse)()
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
60
|
+
,
|
|
61
|
+
__param(0, (0, common_1.Request)()),
|
|
62
|
+
__metadata("design:type", Function),
|
|
63
|
+
__metadata("design:paramtypes", [Object]),
|
|
64
|
+
__metadata("design:returntype", Promise)
|
|
65
|
+
], OrganisationController.prototype, "createCustomerPortalSession", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
|
|
68
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
69
|
+
(0, common_1.Post)("checkout-session"),
|
|
70
|
+
(0, swagger_1.ApiOkResponse)()
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
72
|
+
,
|
|
73
|
+
__param(0, (0, common_1.Request)()),
|
|
74
|
+
__param(1, (0, common_1.Body)()),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [Object, StripeCheckoutSessionParams_1.StripeCheckoutSessionParameters]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], OrganisationController.prototype, "createCheckoutSession", null);
|
|
79
|
+
OrganisationController = __decorate([
|
|
80
|
+
(0, common_1.Controller)("payments/stripe"),
|
|
81
|
+
(0, swagger_1.ApiTags)("payments"),
|
|
82
|
+
__metadata("design:paramtypes", [stripe_checkout_service_1.StripeCheckoutService,
|
|
83
|
+
stripe_webhook_handler_service_1.StripeWebhookHandler])
|
|
84
|
+
], OrganisationController);
|
|
85
|
+
exports.OrganisationController = OrganisationController;
|
|
86
|
+
//# sourceMappingURL=stripe-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|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;;yEAI3C;AAOK;IALL,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAA,uBAAa,GAAE;IACf,IAAA,aAAI,EAAC,kBAAkB,CAAC;IACxB,IAAA,uBAAa,GAAE;IAChB,6DAA6D;;IAExD,WAAA,IAAA,gBAAO,GAAE,CAAA;IACT,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAmB,6DAA+B;;mEAG5D;AApCQ,sBAAsB;IAFlC,IAAA,mBAAU,EAAC,iBAAiB,CAAC;IAC7B,IAAA,iBAAO,EAAC,UAAU,CAAC;qCAGoB,+CAAqB;QACd,qDAAoB;GAHtD,sBAAsB,CAqClC;AArCY,wDAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darraghor/nest-backend-libs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Some helpers for personal projects in nestjs",
|
|
6
6
|
"homepage": "https://github.com/darraghoriordan/nest-backend-libs",
|
|
@@ -56,61 +56,64 @@
|
|
|
56
56
|
"@nestjs/platform-express": "^9.0.0",
|
|
57
57
|
"@nestjs/swagger": "^6.1.4",
|
|
58
58
|
"@nestjs/typeorm": "^9.0.0",
|
|
59
|
-
"auth0": "3.1.
|
|
59
|
+
"auth0": "3.1.2",
|
|
60
60
|
"class-transformer": "0.5.1",
|
|
61
61
|
"class-validator": "0.14.0",
|
|
62
62
|
"date-fns": "2.29.3",
|
|
63
63
|
"dotenv": "16.0.3",
|
|
64
64
|
"jwks-rsa": "3.0.1",
|
|
65
|
-
"nodemailer": "6.9.
|
|
65
|
+
"nodemailer": "6.9.1",
|
|
66
66
|
"passport": "0.6.0",
|
|
67
67
|
"passport-jwt": "4.0.1",
|
|
68
68
|
"pg": "8.8.0",
|
|
69
69
|
"reflect-metadata": "0.1.13",
|
|
70
70
|
"res": "^0.4.0",
|
|
71
71
|
"resource": "0.8.1",
|
|
72
|
-
"rimraf": "4.
|
|
72
|
+
"rimraf": "4.1.2",
|
|
73
73
|
"rxjs": "7.8.0",
|
|
74
|
+
"stripe": "11.8.0",
|
|
74
75
|
"swagger-ui-express": "4.6.0",
|
|
75
76
|
"tslog": "3.3.4",
|
|
76
|
-
"twitter-api-v2": "1.
|
|
77
|
+
"twitter-api-v2": "1.14.0",
|
|
77
78
|
"typeorm": "^0.3.11"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
81
|
"@commitlint/cli": "17.4.2",
|
|
81
82
|
"@commitlint/config-conventional": "17.4.2",
|
|
82
83
|
"@darraghor/eslint-plugin-nestjs-typed": "3.18.0",
|
|
83
|
-
"@nestjs/
|
|
84
|
+
"@nestjs/bull": "0.6.2",
|
|
85
|
+
"@nestjs/cli": "9.1.9",
|
|
84
86
|
"@nestjs/schematics": "^9.0.4",
|
|
85
87
|
"@semantic-release/changelog": "6.0.2",
|
|
86
88
|
"@semantic-release/exec": "6.0.3",
|
|
87
|
-
"@types/auth0": "2.35.
|
|
88
|
-
"@types/express": "4.17.
|
|
89
|
-
"@types/jest": "29.
|
|
89
|
+
"@types/auth0": "2.35.9",
|
|
90
|
+
"@types/express": "4.17.16",
|
|
91
|
+
"@types/jest": "29.4.0",
|
|
90
92
|
"@types/node": "18.11.18",
|
|
91
93
|
"@types/nodemailer": "6.4.7",
|
|
92
94
|
"@types/passport-jwt": "3.0.8",
|
|
93
95
|
"@types/rimraf": "3.0.2",
|
|
94
96
|
"@types/supertest": "2.0.12",
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
96
|
-
"@typescript-eslint/parser": "5.
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "5.49.0",
|
|
98
|
+
"@typescript-eslint/parser": "5.49.0",
|
|
99
|
+
"bull": "4.10.2",
|
|
97
100
|
"copyfiles": "2.4.1",
|
|
98
|
-
"eslint": "8.
|
|
101
|
+
"eslint": "8.32.0",
|
|
99
102
|
"eslint-config-prettier": "8.6.0",
|
|
100
103
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
101
104
|
"eslint-plugin-jest": "27.2.1",
|
|
102
|
-
"eslint-plugin-jsdoc": "39.6.
|
|
105
|
+
"eslint-plugin-jsdoc": "39.6.9",
|
|
103
106
|
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
104
107
|
"eslint-plugin-promise": "6.1.1",
|
|
105
108
|
"eslint-plugin-sonarjs": "0.18.0",
|
|
106
109
|
"eslint-plugin-unicorn": "45.0.2",
|
|
107
110
|
"husky": "8.0.3",
|
|
108
|
-
"jest": "29.
|
|
111
|
+
"jest": "29.4.1",
|
|
109
112
|
"jest-create-mock-instance": "2.0.0",
|
|
110
113
|
"lint-staged": "13.1.0",
|
|
111
|
-
"prettier": "2.8.
|
|
112
|
-
"semantic-release": "20.0
|
|
113
|
-
"ts-jest": "29.0.
|
|
114
|
+
"prettier": "2.8.3",
|
|
115
|
+
"semantic-release": "20.1.0",
|
|
116
|
+
"ts-jest": "29.0.5",
|
|
114
117
|
"ts-loader": "9.4.2",
|
|
115
118
|
"ts-node": "10.9.1",
|
|
116
119
|
"tsconfig-paths": "4.1.2",
|