@darraghor/nest-backend-libs 2.31.0 → 2.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/authorization/authz.module.js +1 -1
  2. package/dist/authorization/authz.module.js.map +1 -1
  3. package/dist/authorization/models/RequestWithUser.d.ts +1 -1
  4. package/dist/authorization/services/UserValidation.service.d.ts +4 -3
  5. package/dist/authorization/services/UserValidation.service.js +35 -29
  6. package/dist/authorization/services/UserValidation.service.js.map +1 -1
  7. package/dist/authorization/strategies/apikeystrategy.d.ts +1 -1
  8. package/dist/authorization/strategies/apikeystrategy.js +3 -2
  9. package/dist/authorization/strategies/apikeystrategy.js.map +1 -1
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +3 -3
  12. package/dist/index.js.map +1 -1
  13. package/dist/invitations/invitation.module.js +1 -1
  14. package/dist/invitations/invitation.module.js.map +1 -1
  15. package/dist/invitations/invitation.service.d.ts +1 -1
  16. package/dist/invitations/invitation.service.js +1 -1
  17. package/dist/invitations/invitation.service.js.map +1 -1
  18. package/dist/organisation/dto/create-organisation.dto.d.ts +1 -1
  19. package/dist/organisation/dto/create-organisation.dto.js +1 -1
  20. package/dist/organisation/dto/create-organisation.dto.js.map +1 -1
  21. package/dist/organisation/entities/organisation.entity.js +2 -0
  22. package/dist/organisation/entities/organisation.entity.js.map +1 -1
  23. package/dist/organisation-memberships/entities/organisation-membership.entity.d.ts +1 -1
  24. package/dist/organisation-memberships/entities/organisation-membership.entity.js +3 -1
  25. package/dist/organisation-memberships/entities/organisation-membership.entity.js.map +1 -1
  26. package/dist/organisation-subscriptions/all-subscriptions.controller.js +2 -1
  27. package/dist/organisation-subscriptions/all-subscriptions.controller.js.map +1 -1
  28. package/dist/organisation-subscriptions/organisation-subscriptions.controller.js +3 -1
  29. package/dist/organisation-subscriptions/organisation-subscriptions.controller.js.map +1 -1
  30. package/dist/payment-sessions/payment-session.controller.js +2 -1
  31. package/dist/payment-sessions/payment-session.controller.js.map +1 -1
  32. package/dist/root-app/app.controller.js +2 -1
  33. package/dist/root-app/app.controller.js.map +1 -1
  34. package/dist/smtp-email-client/email.controller.js +3 -1
  35. package/dist/smtp-email-client/email.controller.js.map +1 -1
  36. package/dist/stripe-client/controllers/stripe-checkout-controller.d.ts +2 -2
  37. package/dist/stripe-client/controllers/stripe-checkout-controller.js +3 -3
  38. package/dist/stripe-client/controllers/stripe-checkout-controller.js.map +1 -1
  39. package/dist/stripe-client/controllers/stripe-customer-portal-controller.d.ts +2 -2
  40. package/dist/stripe-client/controllers/stripe-customer-portal-controller.js +2 -2
  41. package/dist/stripe-client/controllers/stripe-customer-portal-controller.js.map +1 -1
  42. package/dist/stripe-client/controllers/stripe-events-controller.js +2 -1
  43. package/dist/stripe-client/controllers/stripe-events-controller.js.map +1 -1
  44. package/dist/stripe-client/controllers/stripe-webhook-controller.js +3 -1
  45. package/dist/stripe-client/controllers/stripe-webhook-controller.js.map +1 -1
  46. package/dist/stripe-client/models/StripeCheckoutSessionRequestDto.d.ts +1 -1
  47. package/dist/stripe-client/models/StripeCheckoutSessionRequestDto.js +4 -4
  48. package/dist/stripe-client/models/StripeCheckoutSessionRequestDto.js.map +1 -1
  49. package/dist/stripe-client/services/auth-stripe-checkout.service.d.ts +15 -0
  50. package/dist/stripe-client/services/auth-stripe-checkout.service.js +65 -0
  51. package/dist/stripe-client/services/auth-stripe-checkout.service.js.map +1 -0
  52. package/dist/stripe-client/services/queued-payment-event.handler.d.ts +1 -1
  53. package/dist/stripe-client/services/queued-payment-event.handler.js +9 -6
  54. package/dist/stripe-client/services/queued-payment-event.handler.js.map +1 -1
  55. package/dist/stripe-client/services/stripe-checkout.service.d.ts +3 -12
  56. package/dist/stripe-client/services/stripe-checkout.service.js +14 -57
  57. package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
  58. package/dist/stripe-client/stripe-account.module.js +3 -0
  59. package/dist/stripe-client/stripe-account.module.js.map +1 -1
  60. package/dist/super-powers/super-powers.controller.js +2 -1
  61. package/dist/super-powers/super-powers.controller.js.map +1 -1
  62. package/dist/user/dto/create-user.dto.js.map +1 -0
  63. package/dist/user/dto/update-user.dto.js.map +1 -0
  64. package/dist/{user-internal → user}/dto/userResponseDto.d.ts +0 -2
  65. package/dist/{user-internal → user}/dto/userResponseDto.js +0 -6
  66. package/dist/user/dto/userResponseDto.js.map +1 -0
  67. package/dist/{user-internal → user}/entities/user.entity.js +3 -1
  68. package/dist/user/entities/user.entity.js.map +1 -0
  69. package/dist/{user-internal → user}/user-internal.module.js +2 -2
  70. package/dist/user/user-internal.module.js.map +1 -0
  71. package/dist/{user-internal → user}/user.controller.js +2 -4
  72. package/dist/user/user.controller.js.map +1 -0
  73. package/dist/{user-internal → user}/user.service.d.ts +3 -4
  74. package/dist/{user-internal → user}/user.service.js +32 -16
  75. package/dist/user/user.service.js.map +1 -0
  76. package/dist/user-api-key/user-apikey.controller.js +5 -1
  77. package/dist/user-api-key/user-apikey.controller.js.map +1 -1
  78. package/dist/user-api-key/user-apikey.module.js +1 -1
  79. package/dist/user-api-key/user-apikey.module.js.map +1 -1
  80. package/dist/user-api-key/userApiKey.entity.d.ts +1 -1
  81. package/dist/user-api-key/userApiKey.entity.js +1 -1
  82. package/dist/user-api-key/userApiKey.entity.js.map +1 -1
  83. package/package.json +31 -31
  84. package/dist/user-internal/dto/create-user.dto.js.map +0 -1
  85. package/dist/user-internal/dto/update-user.dto.js.map +0 -1
  86. package/dist/user-internal/dto/userResponseDto.js.map +0 -1
  87. package/dist/user-internal/entities/user.entity.js.map +0 -1
  88. package/dist/user-internal/user-internal.module.js.map +0 -1
  89. package/dist/user-internal/user.controller.js.map +0 -1
  90. package/dist/user-internal/user.service.js.map +0 -1
  91. /package/dist/{user-internal → user}/dto/create-user.dto.d.ts +0 -0
  92. /package/dist/{user-internal → user}/dto/create-user.dto.js +0 -0
  93. /package/dist/{user-internal → user}/dto/update-user.dto.d.ts +0 -0
  94. /package/dist/{user-internal → user}/dto/update-user.dto.js +0 -0
  95. /package/dist/{user-internal → user}/entities/user.entity.d.ts +0 -0
  96. /package/dist/{user-internal → user}/user-internal.module.d.ts +0 -0
  97. /package/dist/{user-internal → user}/user.controller.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { RequestWithUser } from "../../authorization/models/RequestWithUser.js";
2
2
  import { StripeCheckoutSessionRequestDto } from "../models/StripeCheckoutSessionRequestDto.js";
3
- import { StripeCheckoutService } from "../services/stripe-checkout.service.js";
4
3
  import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto.js";
4
+ import { AuthenticatedStripeCheckoutService } from "../services/auth-stripe-checkout.service.js";
5
5
  /**
6
6
  * This controller creates authenticated checkout sessions for Stripe.
7
7
  * It adds the user's email address and user ID to the session.
@@ -11,6 +11,6 @@ import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessio
11
11
  */
12
12
  export declare class StripeCheckoutController {
13
13
  private readonly stripeService;
14
- constructor(stripeService: StripeCheckoutService);
14
+ constructor(stripeService: AuthenticatedStripeCheckoutService);
15
15
  createCheckoutSession(request: RequestWithUser, createSessionDto: StripeCheckoutSessionRequestDto): Promise<StripeCheckoutSessionResponseDto>;
16
16
  }
@@ -14,8 +14,8 @@ import { UseGuards, Controller, Post, Body, Request } from "@nestjs/common";
14
14
  import { AuthGuard } from "@nestjs/passport";
15
15
  import { ApiBearerAuth, ApiTags, ApiOkResponse } from "@nestjs/swagger";
16
16
  import { StripeCheckoutSessionRequestDto } from "../models/StripeCheckoutSessionRequestDto.js";
17
- import { StripeCheckoutService } from "../services/stripe-checkout.service.js";
18
17
  import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto.js";
18
+ import { AuthenticatedStripeCheckoutService } from "../services/auth-stripe-checkout.service.js";
19
19
  /**
20
20
  * This controller creates authenticated checkout sessions for Stripe.
21
21
  * It adds the user's email address and user ID to the session.
@@ -30,7 +30,7 @@ let StripeCheckoutController = class StripeCheckoutController {
30
30
  }
31
31
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
32
  async createCheckoutSession(request, createSessionDto) {
33
- return this.stripeService.createAuthenticatedCheckoutSession(createSessionDto, request.user);
33
+ return this.stripeService.createCheckoutSession(createSessionDto, request.user);
34
34
  }
35
35
  };
36
36
  __decorate([
@@ -51,7 +51,7 @@ StripeCheckoutController = __decorate([
51
51
  ApiTags("Payments")
52
52
  // eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
53
53
  ,
54
- __metadata("design:paramtypes", [StripeCheckoutService])
54
+ __metadata("design:paramtypes", [AuthenticatedStripeCheckoutService])
55
55
  ], StripeCheckoutController);
56
56
  export { StripeCheckoutController };
57
57
  //# sourceMappingURL=stripe-checkout-controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-checkout-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-checkout-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,aAAa,EAAE,OAAO,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAC,+BAA+B,EAAC,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAC,qBAAqB,EAAC,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAC,gCAAgC,EAAC,MAAM,+CAA+C,CAAC;AAE/F;;;;;;GAMG;AAMI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACJ;IAA7B,YAA6B,aAAoC;QAApC,kBAAa,GAAb,aAAa,CAAuB;IAAG,CAAC;IAK/D,AADN,6DAA6D;IAC7D,KAAK,CAAC,qBAAqB,CACZ,OAAwB,EAC3B,gBAAiD;QAEzD,OAAO,IAAI,CAAC,aAAa,CAAC,kCAAkC,CACxD,gBAAgB,EAChB,OAAO,CAAC,IAAI,CACf,CAAC;IACN,CAAC;CACJ,CAAA;AATS;IAHL,IAAI,CAAC,kBAAkB,CAAC;IACxB,aAAa,CAAC,EAAC,IAAI,EAAE,gCAAgC,EAAC,CAAC;IACxD,6DAA6D;;IAExD,WAAA,OAAO,EAAE,CAAA;IACT,WAAA,IAAI,EAAE,CAAA;;6CAAmB,+BAA+B;;qEAM5D;AAdQ,wBAAwB;IALpC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,aAAa,EAAE;IACf,UAAU,CAAC,iBAAiB,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAC;IACpB,iFAAiF;;qCAEjC,qBAAqB;GADxD,wBAAwB,CAepC;SAfY,wBAAwB"}
1
+ {"version":3,"file":"stripe-checkout-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-checkout-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,aAAa,EAAE,OAAO,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAC,+BAA+B,EAAC,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAC,gCAAgC,EAAC,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAC,kCAAkC,EAAC,MAAM,6CAA6C,CAAC;AAE/F;;;;;;GAMG;AAMI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAEZ;IADrB,YACqB,aAAiD;QAAjD,kBAAa,GAAb,aAAa,CAAoC;IACnE,CAAC;IAKE,AADN,6DAA6D;IAC7D,KAAK,CAAC,qBAAqB,CACZ,OAAwB,EAC3B,gBAAiD;QAEzD,OAAO,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAC3C,gBAAgB,EAChB,OAAO,CAAC,IAAI,CACf,CAAC;IACN,CAAC;CACJ,CAAA;AATS;IAHL,IAAI,CAAC,kBAAkB,CAAC;IACxB,aAAa,CAAC,EAAC,IAAI,EAAE,gCAAgC,EAAC,CAAC;IACxD,6DAA6D;;IAExD,WAAA,OAAO,EAAE,CAAA;IACT,WAAA,IAAI,EAAE,CAAA;;6CAAmB,+BAA+B;;qEAM5D;AAhBQ,wBAAwB;IALpC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,aAAa,EAAE;IACf,UAAU,CAAC,iBAAiB,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAC;IACpB,iFAAiF;;qCAGzC,kCAAkC;GAF7D,wBAAwB,CAiBpC;SAjBY,wBAAwB"}
@@ -1,9 +1,9 @@
1
1
  import { RequestWithUser } from "../../authorization/models/RequestWithUser.js";
2
- import { StripeCheckoutService } from "./../services/stripe-checkout.service.js";
3
2
  import { StripeCustomerPortalResponseDto } from "../models/StripeCustomerPortalResponseDto.js";
4
3
  import { StripeCustomerPortalRequestDto } from "../models/StripeCustomerPortalRequestDto.js";
4
+ import { AuthenticatedStripeCheckoutService } from "../services/auth-stripe-checkout.service.js";
5
5
  export declare class StripeCustomerPortalController {
6
6
  private readonly stripeService;
7
- constructor(stripeService: StripeCheckoutService);
7
+ constructor(stripeService: AuthenticatedStripeCheckoutService);
8
8
  createCustomerPortalSession(request: RequestWithUser, body: StripeCustomerPortalRequestDto): Promise<StripeCustomerPortalResponseDto>;
9
9
  }
@@ -13,9 +13,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  import { UseGuards, Controller, Post, Request, Body } from "@nestjs/common";
14
14
  import { AuthGuard } from "@nestjs/passport";
15
15
  import { ApiBearerAuth, ApiTags, ApiOkResponse } from "@nestjs/swagger";
16
- import { StripeCheckoutService } from "./../services/stripe-checkout.service.js";
17
16
  import { StripeCustomerPortalResponseDto } from "../models/StripeCustomerPortalResponseDto.js";
18
17
  import { StripeCustomerPortalRequestDto } from "../models/StripeCustomerPortalRequestDto.js";
18
+ import { AuthenticatedStripeCheckoutService } from "../services/auth-stripe-checkout.service.js";
19
19
  let StripeCustomerPortalController = class StripeCustomerPortalController {
20
20
  stripeService;
21
21
  constructor(stripeService) {
@@ -45,7 +45,7 @@ __decorate([
45
45
  StripeCustomerPortalController = __decorate([
46
46
  Controller("payments/stripe"),
47
47
  ApiTags("Payments"),
48
- __metadata("design:paramtypes", [StripeCheckoutService])
48
+ __metadata("design:paramtypes", [AuthenticatedStripeCheckoutService])
49
49
  ], StripeCustomerPortalController);
50
50
  export { StripeCustomerPortalController };
51
51
  //# sourceMappingURL=stripe-customer-portal-controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-customer-portal-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-customer-portal-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,aAAa,EAAE,OAAO,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAC,qBAAqB,EAAC,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAC,+BAA+B,EAAC,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAC,8BAA8B,EAAC,MAAM,6CAA6C,CAAC;AAIpF,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACV;IAA7B,YAA6B,aAAoC;QAApC,kBAAa,GAAb,aAAa,CAAuB;IAAG,CAAC;IAU/D,AADN,6DAA6D;IAC7D,KAAK,CAAC,2BAA2B,CAClB,OAAwB,EAC3B,IAAoC;QAE5C,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,2BAA2B,CACvD,IAAI,EACJ,OAAO,CAAC,IAAI,CACf,CAAC;IACN,CAAC;CACJ,CAAA;AATS;IARL,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,aAAa,EAAE;IACf,IAAI,CAAC,yBAAyB,CAAC;IAC/B,aAAa,CAAC;QACX,IAAI,EAAE,+BAA+B;QACrC,WAAW,EAAE,gCAAgC;KAChD,CAAC;IACF,6DAA6D;;IAExD,WAAA,OAAO,EAAE,CAAA;IACT,WAAA,IAAI,EAAE,CAAA;;6CAAO,8BAA8B;;iFAM/C;AAnBQ,8BAA8B;IAF1C,UAAU,CAAC,iBAAiB,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAC;qCAE4B,qBAAqB;GADxD,8BAA8B,CAoB1C;SApBY,8BAA8B"}
1
+ {"version":3,"file":"stripe-customer-portal-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-customer-portal-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,aAAa,EAAE,OAAO,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAC,+BAA+B,EAAC,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAC,8BAA8B,EAAC,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAC,kCAAkC,EAAC,MAAM,6CAA6C,CAAC;AAIxF,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAElB;IADrB,YACqB,aAAiD;QAAjD,kBAAa,GAAb,aAAa,CAAoC;IACnE,CAAC;IAUE,AADN,6DAA6D;IAC7D,KAAK,CAAC,2BAA2B,CAClB,OAAwB,EAC3B,IAAoC;QAE5C,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,2BAA2B,CACvD,IAAI,EACJ,OAAO,CAAC,IAAI,CACf,CAAC;IACN,CAAC;CACJ,CAAA;AATS;IARL,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,aAAa,EAAE;IACf,IAAI,CAAC,yBAAyB,CAAC;IAC/B,aAAa,CAAC;QACX,IAAI,EAAE,+BAA+B;QACrC,WAAW,EAAE,gCAAgC;KAChD,CAAC;IACF,6DAA6D;;IAExD,WAAA,OAAO,EAAE,CAAA;IACT,WAAA,IAAI,EAAE,CAAA;;6CAAO,8BAA8B;;iFAM/C;AArBQ,8BAA8B;IAF1C,UAAU,CAAC,iBAAiB,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAC;qCAGoB,kCAAkC;GAF7D,8BAA8B,CAsB1C;SAtBY,8BAA8B"}
@@ -11,7 +11,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { UseGuards, Controller, Request, Get, Query } from "@nestjs/common";
14
- import { ApiBearerAuth, ApiTags, ApiOkResponse, ApiQuery } from "@nestjs/swagger";
14
+ import { ApiBearerAuth, ApiTags, ApiOkResponse, ApiQuery, ApiOperation, } from "@nestjs/swagger";
15
15
  import { StripeCheckoutService } from "../services/stripe-checkout.service.js";
16
16
  import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity.js";
17
17
  import { ClaimsAuthorisationGuard } from "../../authorization/guards/ClaimsAuthorisationGuard.js";
@@ -29,6 +29,7 @@ let StripeEventsController = class StripeEventsController {
29
29
  };
30
30
  __decorate([
31
31
  MandatoryUserClaims("read:all"),
32
+ ApiOperation({ tags: ["SuperPower"] }),
32
33
  Get(),
33
34
  ApiQuery({ name: "take", required: true, type: Number }),
34
35
  ApiQuery({ name: "skip", required: true, type: Number }),
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-events-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-events-controller.ts"],"names":[],"mappings":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;IAJlC,SAAS,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;IACrD,aAAa,EAAE;IACf,UAAU,CAAC,wBAAwB,CAAC;IACpC,OAAO,CAAC,UAAU,CAAC;qCAE4B,qBAAqB;GADxD,sBAAsB,CAelC;SAfY,sBAAsB"}
1
+ {"version":3,"file":"stripe-events-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-events-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EACH,aAAa,EACb,OAAO,EACP,aAAa,EACb,QAAQ,EACR,YAAY,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,qBAAqB,EAAC,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAC,wBAAwB,EAAC,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAC,gBAAgB,EAAC,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAC,mBAAmB,EAAC,MAAM,6DAA6D,CAAC;AAWzF,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACF;IAA7B,YAA6B,aAAoC;QAApC,kBAAa,GAAb,aAAa,CAAuB;IAAG,CAAC;IAS/D,AADN,6DAA6D;IAC7D,KAAK,CAAC,aAAa,CACJ,OAAwB,EAC1B,KAAiB;QAE1B,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;AANS;IAPL,mBAAmB,CAAC,UAAU,CAAC;IAC/B,YAAY,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;IACpC,GAAG,EAAE;IACL,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;IACtD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;IACtD,aAAa,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;IAC1D,6DAA6D;;IAExD,WAAA,OAAO,EAAE,CAAA;IACT,WAAA,KAAK,EAAE,CAAA;;;;2DAGX;AAfQ,sBAAsB;IAJlC,SAAS,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;IACrD,aAAa,EAAE;IACf,UAAU,CAAC,wBAAwB,CAAC;IACpC,OAAO,CAAC,UAAU,CAAC;qCAE4B,qBAAqB;GADxD,sBAAsB,CAgBlC;SAhBY,sBAAsB"}
@@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  };
13
13
  import { InjectQueue } from "@nestjs/bull";
14
14
  import { Controller, Get, Post, Req, UseGuards, } from "@nestjs/common";
15
- import { ApiTags, ApiOkResponse, ApiBadRequestResponse, ApiBearerAuth, } from "@nestjs/swagger";
15
+ import { ApiTags, ApiOkResponse, ApiBadRequestResponse, ApiBearerAuth, ApiOperation, } from "@nestjs/swagger";
16
16
  import { StripeWebhookHandler } from "./../services/stripe-webhook-handler.service.js";
17
17
  import { QueueItemDto } from "../../root-app/models/QueueItemDto.js";
18
18
  import { ClaimsAuthorisationGuard } from "../../authorization/guards/ClaimsAuthorisationGuard.js";
@@ -85,6 +85,7 @@ __decorate([
85
85
  __decorate([
86
86
  UseGuards(DefaultAuthGuard, ClaimsAuthorisationGuard),
87
87
  ApiBearerAuth(),
88
+ ApiOperation({ tags: ["SuperPower"] }),
88
89
  MandatoryUserClaims("read:all"),
89
90
  Get("peekalljobs"),
90
91
  ApiOkResponse({ type: [QueueItemDto] }),
@@ -95,6 +96,7 @@ __decorate([
95
96
  __decorate([
96
97
  UseGuards(DefaultAuthGuard, ClaimsAuthorisationGuard),
97
98
  ApiBearerAuth(),
99
+ ApiOperation({ tags: ["SuperPower"] }),
98
100
  MandatoryUserClaims("read:all"),
99
101
  Get("peekfailedjobs")
100
102
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-webhook-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-webhook-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EACH,UAAU,EACV,GAAG,EACH,IAAI,EAEJ,GAAG,EACH,SAAS,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,aAAa,GAChB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAC,oBAAoB,EAAC,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAC,wBAAwB,EAAC,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAC,gBAAgB,EAAC,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAC,mBAAmB,EAAC,MAAM,6DAA6D,CAAC;AAEhG;;;;GAIG;AAGI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAEX;IAET;IAHZ,YACqB,oBAA0C,EAEnD,KAAY;QAFH,yBAAoB,GAApB,oBAAoB,CAAsB;QAEnD,UAAK,GAAL,KAAK,CAAO;IACrB,CAAC;IAEJ,4DAA4D;IAKtD,AADN,4FAA4F;IAC5F,KAAK,CAAC,eAAe,CAAQ,GAAmC;QAC5D,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACxD,CAAC;IAOK,AAAN,KAAK,CAAC,aAAa;QACf,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,C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IACf,mBAAmB,CAAC,UAAU,CAAC;IAC/B,GAAG,CAAC,aAAa,CAAC;IAClB,aAAa,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;;;;4DAsBrC;AAQK;IANL,SAAS,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;IACrD,aAAa,EAAE;IACf,mBAAmB,CAAC,UAAU,CAAC;IAC/B,GAAG,CAAC,gBAAgB,CAAC;IACtB,mEAAmE;;IAClE,aAAa,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;;;;kEAerC;AAhEQ,uBAAuB;IAFnC,UAAU,CAAC,iBAAiB,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAC;IAIX,WAAA,WAAW,CAAC,eAAe,CAAC,CAAA;qCADU,oBAAoB;GAFtD,uBAAuB,CAiEnC;SAjEY,uBAAuB"}
1
+ {"version":3,"file":"stripe-webhook-controller.js","sourceRoot":"","sources":["../../../src/stripe-client/controllers/stripe-webhook-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EACH,UAAU,EACV,GAAG,EACH,IAAI,EAEJ,GAAG,EACH,SAAS,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,YAAY,GACf,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAC,oBAAoB,EAAC,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAC,wBAAwB,EAAC,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAC,gBAAgB,EAAC,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAC,mBAAmB,EAAC,MAAM,6DAA6D,CAAC;AAEhG;;;;GAIG;AAGI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAEX;IAET;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AC,WAAW;gBACvB,mEAAmE;gBACnE,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,UAAU,EAAE,GAAG,CAAC,YAAY;aAC/B,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAvDS;IAJL,IAAI,CAAC,kBAAkB,CAAC;IACxB,aAAa,EAAE;IACf,qBAAqB,EAAE;IACxB,4FAA4F;;IACrE,WAAA,GAAG,EAAE,CAAA;;;;8DAE3B;AAQK;IANL,SAAS,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;IACrD,aAAa,EAAE;IACf,YAAY,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;IACpC,mBAAmB,CAAC,UAAU,CAAC;IAC/B,GAAG,CAAC,aAAa,CAAC;IAClB,aAAa,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;;;;4DAsBrC;AASK;IAPL,SAAS,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;IACrD,aAAa,EAAE;IACf,YAAY,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;IACpC,mBAAmB,CAAC,UAAU,CAAC;IAC/B,GAAG,CAAC,gBAAgB,CAAC;IACtB,mEAAmE;;IAClE,aAAa,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;;;;kEAerC;AAlEQ,uBAAuB;IAFnC,UAAU,CAAC,iBAAiB,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAC;IAIX,WAAA,WAAW,CAAC,eAAe,CAAC,CAAA;qCADU,oBAAoB;GAFtD,uBAAuB,CAmEnC;SAnEY,uBAAuB"}
@@ -1,6 +1,6 @@
1
1
  import { StripeCheckoutLineItem } from "./StripeCheckoutLineItem.js";
2
2
  export declare class StripeCheckoutSessionRequestDto {
3
- organisationId?: string;
3
+ organisationUuid?: string;
4
4
  lineItems: StripeCheckoutLineItem[];
5
5
  mode: "subscription" | "payment" | "setup";
6
6
  successFrontendPath: string;
@@ -14,7 +14,7 @@ import { Type } from "class-transformer";
14
14
  import { IsArray, IsIn, IsOptional, IsString, ValidateNested, } from "class-validator";
15
15
  import { StripeCheckoutLineItem } from "./StripeCheckoutLineItem.js";
16
16
  export class StripeCheckoutSessionRequestDto {
17
- organisationId;
17
+ organisationUuid;
18
18
  lineItems;
19
19
  // eslint-disable-next-line @darraghor/nestjs-typed/validated-non-primitive-property-needs-type-decorator
20
20
  mode;
@@ -25,7 +25,7 @@ __decorate([
25
25
  ApiPropertyOptional(),
26
26
  IsOptional(),
27
27
  __metadata("design:type", String)
28
- ], StripeCheckoutSessionRequestDto.prototype, "organisationId", void 0);
28
+ ], StripeCheckoutSessionRequestDto.prototype, "organisationUuid", void 0);
29
29
  __decorate([
30
30
  ApiProperty({ isArray: true, type: StripeCheckoutLineItem }),
31
31
  IsArray(),
@@ -40,14 +40,14 @@ __decorate([
40
40
  ], StripeCheckoutSessionRequestDto.prototype, "mode", void 0);
41
41
  __decorate([
42
42
  ApiProperty({
43
- description: "The URL to which Stripe should redirect the customer after payment. This is appended to the host configured in the StripeClientConfigurationService",
43
+ description: "The path on frontend to which Stripe should redirect the customer after payment. This is appended to the host configured in the StripeClientConfigurationService",
44
44
  }),
45
45
  IsString(),
46
46
  __metadata("design:type", String)
47
47
  ], StripeCheckoutSessionRequestDto.prototype, "successFrontendPath", void 0);
48
48
  __decorate([
49
49
  ApiPropertyOptional({
50
- description: "The URL to which Stripe should redirect the customer after payment cancellation. This is appended to the host configured in the StripeClientConfigurationService",
50
+ description: "The path on frontend to which Stripe should redirect the customer after payment cancellation. This is appended to the host configured in the StripeClientConfigurationService",
51
51
  }),
52
52
  IsOptional(),
53
53
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"StripeCheckoutSessionRequestDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionRequestDto.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;AACzB,OAAO,EAAC,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAEnE,MAAM,OAAO,+BAA+B;IAGxC,cAAc,CAAU;IAMxB,SAAS,CAA4B;IAErC,yGAAyG;IAGzG,IAAI,CAAwC;IAO5C,mBAAmB,CAAU;IAO7B,kBAAkB,CAAU;CAC/B;AA5BG;IAAC,mBAAmB,EAAE;IACrB,UAAU,EAAE;;uEACW;AAExB;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
+ {"version":3,"file":"StripeCheckoutSessionRequestDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionRequestDto.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;AACzB,OAAO,EAAC,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAEnE,MAAM,OAAO,+BAA+B;IAGxC,gBAAgB,CAAU;IAM1B,SAAS,CAA4B;IAErC,yGAAyG;IAGzG,IAAI,CAAwC;IAO5C,mBAAmB,CAAU;IAO7B,kBAAkB,CAAU;CAC/B;AA5BG;IAAC,mBAAmB,EAAE;IACrB,UAAU,EAAE;;yEACa;AAE1B;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,kKAAkK;KACzK,CAAC;IACD,QAAQ,EAAE;;4EACkB;AAE7B;IAAC,mBAAmB,CAAC;QACjB,WAAW,EACP,+KAA+K;KACtL,CAAC;IACD,UAAU,EAAE;;2EACe"}
@@ -0,0 +1,15 @@
1
+ import { RequestUser } from "../../authorization/models/RequestWithUser.js";
2
+ import { StripeCheckoutSessionRequestDto } from "../models/StripeCheckoutSessionRequestDto.js";
3
+ import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto.js";
4
+ import { StripeCustomerPortalResponseDto } from "../models/StripeCustomerPortalResponseDto.js";
5
+ import { StripeCustomerPortalRequestDto } from "../models/StripeCustomerPortalRequestDto.js";
6
+ import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
7
+ import { StripeCheckoutService } from "./stripe-checkout.service.js";
8
+ export declare class AuthenticatedStripeCheckoutService {
9
+ private readonly organisationSubscriptionService;
10
+ private readonly stripeCheckoutService;
11
+ private readonly logger;
12
+ constructor(organisationSubscriptionService: OrganisationSubscriptionService, stripeCheckoutService: StripeCheckoutService);
13
+ createCustomerPortalSession(parameters: StripeCustomerPortalRequestDto, user: RequestUser): Promise<StripeCustomerPortalResponseDto>;
14
+ createCheckoutSession(parameters: StripeCheckoutSessionRequestDto, user: RequestUser): Promise<StripeCheckoutSessionResponseDto>;
15
+ }
@@ -0,0 +1,65 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var AuthenticatedStripeCheckoutService_1;
11
+ /* eslint-disable @typescript-eslint/naming-convention */
12
+ import { Injectable, Logger } from "@nestjs/common";
13
+ import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
14
+ import { StripeCheckoutService } from "./stripe-checkout.service.js";
15
+ let AuthenticatedStripeCheckoutService = AuthenticatedStripeCheckoutService_1 = class AuthenticatedStripeCheckoutService {
16
+ organisationSubscriptionService;
17
+ stripeCheckoutService;
18
+ logger = new Logger(AuthenticatedStripeCheckoutService_1.name);
19
+ constructor(organisationSubscriptionService, stripeCheckoutService) {
20
+ this.organisationSubscriptionService = organisationSubscriptionService;
21
+ this.stripeCheckoutService = stripeCheckoutService;
22
+ }
23
+ // must set the org id to the customer id field so we can get this later
24
+ async createCustomerPortalSession(parameters, user) {
25
+ // is the user an owner of the organisation with the subscription record
26
+ const subscriptionRecord = await this.organisationSubscriptionService.findOne(parameters.subscriptionRecordUuid);
27
+ if (!user.memberships ||
28
+ !user.memberships
29
+ .filter((m) => m.roles?.some((r) => r.name === "owner"))
30
+ .map((m) => m.organisation.uuid)
31
+ .includes(subscriptionRecord.organisation.uuid)) {
32
+ {
33
+ this.logger.error("Create Stripe session error. Not an owner of the organisation", {
34
+ userUuid: user.uuid,
35
+ organisationUuid: subscriptionRecord.organisation.uuid,
36
+ });
37
+ throw new Error("You are not a member of the organisation associated with this billing account");
38
+ }
39
+ }
40
+ return this.stripeCheckoutService.createStripePortalSession(subscriptionRecord.paymentSystemCustomerId, parameters.returnUrl);
41
+ }
42
+ async createCheckoutSession(parameters, user) {
43
+ // is the current user the owner of the org?
44
+ if (!parameters.organisationUuid ||
45
+ !user.memberships ||
46
+ !user.memberships
47
+ .filter((m) => m.roles?.some((r) => r.name === "owner"))
48
+ .map((m) => m.organisation.uuid)
49
+ .includes(parameters.organisationUuid)) {
50
+ this.logger.error("Create Stripe session error. Not an owner of the organisation", {
51
+ userUuid: user.uuid,
52
+ organisationUuid: parameters.organisationUuid,
53
+ });
54
+ throw new Error("You are not the owner of this organisation");
55
+ }
56
+ return this.stripeCheckoutService.createCheckoutSession(parameters);
57
+ }
58
+ };
59
+ AuthenticatedStripeCheckoutService = AuthenticatedStripeCheckoutService_1 = __decorate([
60
+ Injectable(),
61
+ __metadata("design:paramtypes", [OrganisationSubscriptionService,
62
+ StripeCheckoutService])
63
+ ], AuthenticatedStripeCheckoutService);
64
+ export { AuthenticatedStripeCheckoutService };
65
+ //# sourceMappingURL=auth-stripe-checkout.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-stripe-checkout.service.js","sourceRo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AAC;gBACF,MAAM,IAAI,KAAK,CACX,+EAA+E,CAClF,CAAC;aACL;SACJ;QACD,OAAO,IAAI,CAAC,qBAAqB,CAAC,yBAAyB,CACvD,kBAAkB,CAAC,uBAAuB,EAC1C,UAAU,CAAC,SAAS,CACvB,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAC9B,UAA2C,EAC3C,IAAiB;QAEjB,4CAA4C;QAC5C,IACI,CAAC,UAAU,CAAC,gBAAgB;YAC5B,CAAC,IAAI,CAAC,WAAW;YACjB,CAAC,IAAI,CAAC,WAAW;iBACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;iBACvD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC;iBAC/B,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAC5C;YACE,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,+DAA+D,EAC/D;gBACI,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;aAChD,CACJ,CAAC;YACF,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SACjE;QAED,OAAO,IAAI,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACxE,CAAC;CACJ,CAAA;AAtEY,kCAAkC;IAD9C,UAAU,EAAE;qCAM6C,+BAA+B;QACzC,qBAAqB;GANxD,kCAAkC,CAsE9C;SAtEY,kCAAkC"}
@@ -14,7 +14,7 @@ export declare class StripeQueuedEventHandler {
14
14
  onActive(job: Job<Stripe.Event>): void;
15
15
  onComplete(job: Job<Stripe.Event>): void;
16
16
  mapCheckoutSessionToSubFulfilment(fullSession: Stripe.Response<Stripe.Checkout.Session>): SaveOrganisationSubscriptionRecordDto[];
17
- private stripeFulfillmentDtoFactory;
17
+ private createFulfilmentDto;
18
18
  mapInvoiceToSubFulfilment(fullInvoice: Stripe.Response<Stripe.Invoice>): SaveOrganisationSubscriptionRecordDto[];
19
19
  private mapPaymentType;
20
20
  private mapNewValidUntil;
@@ -52,7 +52,7 @@ let StripeQueuedEventHandler = StripeQueuedEventHandler_1 = class StripeQueuedEv
52
52
  // for one-off products use today + 100 years
53
53
  const subs = [];
54
54
  for (const lineItem of fullSession.line_items.data) {
55
- const subscriptionFulfilmentDto = this.stripeFulfillmentDtoFactory(lineItem.price?.product, fullSession.customer, fullSession.customer_email, fullSession.customer_details?.email);
55
+ const subscriptionFulfilmentDto = this.createFulfilmentDto(lineItem.price?.product, fullSession.customer, fullSession.customer_email, fullSession.customer_details?.email);
56
56
  subscriptionFulfilmentDto.paymentSystemMode = this.mapPaymentType(lineItem.price?.type, fullSession.mode);
57
57
  subscriptionFulfilmentDto.validUntil = this.mapNewValidUntil(subscriptionFulfilmentDto.paymentSystemMode, true, fullSession.subscription
58
58
  .current_period_end);
@@ -67,7 +67,7 @@ let StripeQueuedEventHandler = StripeQueuedEventHandler_1 = class StripeQueuedEv
67
67
  }
68
68
  return subs;
69
69
  }
70
- stripeFulfillmentDtoFactory(product, customer, altEmail, altEmail2) {
70
+ createFulfilmentDto(product, customer, altEmail, altEmail2) {
71
71
  const subscriptionFulfilmentDto = new SaveOrganisationSubscriptionRecordDto();
72
72
  subscriptionFulfilmentDto.paymentSystemName = "stripe";
73
73
  subscriptionFulfilmentDto.paymentSystemProductId = product?.id;
@@ -86,7 +86,7 @@ let StripeQueuedEventHandler = StripeQueuedEventHandler_1 = class StripeQueuedEv
86
86
  // for one-off products use today + 100 years
87
87
  const subs = [];
88
88
  for (const lineItem of fullInvoice.lines.data) {
89
- const subscriptionFulfilmentDto = this.stripeFulfillmentDtoFactory(lineItem.price?.product, fullInvoice.customer, fullInvoice.customer_email);
89
+ const subscriptionFulfilmentDto = this.createFulfilmentDto(lineItem.price?.product, fullInvoice.customer, fullInvoice.customer_email);
90
90
  const fullSubscription = fullInvoice.subscription;
91
91
  subscriptionFulfilmentDto.paymentSystemMode = this.mapPaymentType(lineItem.price?.type);
92
92
  subscriptionFulfilmentDto.validUntil = this.mapNewValidUntil(subscriptionFulfilmentDto.paymentSystemMode, fullSubscription.status === "active" ||
@@ -130,7 +130,7 @@ let StripeQueuedEventHandler = StripeQueuedEventHandler_1 = class StripeQueuedEv
130
130
  // for one-off products use today + 100 years
131
131
  const subs = [];
132
132
  for (const lineItem of fullSubscription.items.data) {
133
- const subscriptionFulfilmentDto = this.stripeFulfillmentDtoFactory(lineItem.price?.product, fullSubscription.customer);
133
+ const subscriptionFulfilmentDto = this.createFulfilmentDto(lineItem.price?.product, fullSubscription.customer);
134
134
  subscriptionFulfilmentDto.paymentSystemMode = "subscription";
135
135
  subscriptionFulfilmentDto.paymentSystemTransactionId =
136
136
  fullSubscription.id;
@@ -340,8 +340,11 @@ __decorate([
340
340
  StripeQueuedEventHandler = StripeQueuedEventHandler_1 = __decorate([
341
341
  Injectable(),
342
342
  Processor("stripe-events")
343
- // This is just an example with notes. You should create your own handler
344
- //
343
+ // This is just a looong example with notes. You should create your own handler
344
+ // with this as a reference
345
+ // You likely only need to handle the "checkout.session.completed" event for purchases
346
+ // and the "customer.subscription.updated" event for subscription updates
347
+ // https://stripe.com/docs/billing/subscriptions/webhooks
345
348
  // eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
346
349
  ,
347
350
  __param(0, Inject("StripeClient")),
@@ -1 +1 @@
1
- {"version":3,"file":"queued-payment-event.handler.js","sourceRoot":"","sources":["../../../src/stripe-client/services/queued-payment-event.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,gDAAgD;AAChD,6DAA6D;AAC7D,mDAAmD;AACnD,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAC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;oBACI,MAAM,EAAE,CAAC,0BAA0B,EAAE,UAAU,CAAC;iBACnD,CACJ,CAAC;gBACN,MAAM,IAAI,GAAG,IAAI,CAAC,8BAA8B,CAC5C,gBAAgB,EAChB;oBACI,QAAQ,EACJ,gBAAgB,CAAC,MAAM,KAAK,QAAQ;wBACpC,gBAAgB,CAAC,MAAM,KAAK,UAAU;iBAC7C,CACJ,CAAC;gBAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAC1D,IAAI,CACP,CAAC;gBAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAC,MAAM,EAAC,CAAC,CAAC;gBAClD,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,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI;iBACtB,CAAC,CAAC;aACN;SACJ;IACL,CAAC;CACJ,CAAA;AAvaG;IAAC,aAAa,EAAE;;6CACuB,KAAK;;uDAO3C;AAED;IAAC,aAAa,EAAE;IAChB,0DAA0D;;;;;wDAGzD;AAED;IAAC,gBAAgB,EAAE;IACnB,0DAA0D;;;;;0DAGzD;AAoLY;IADZ,OAAO,EAAE;;;;2DA+NT;AA/aQ,wBAAwB;IALpC,UAAU,EAAE;IACZ,SAAS,CAAC,eAAe,CAAC;IAC3B,yEAAyE;IACzE,EAAE;IACF,iFAAiF;;IAIxE,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IAEtB,WAAA,gBAAgB,CAAC,mBAAmB,CAAC,CAAA;qCADb,MAAM;QAEiB,UAAU;QACR,+BAA+B;GAP5E,wBAAwB,CAgbpC;SAhbY,wBAAwB"}
1
+ {"version":3,"file":"queued-payment-event.handler.js","sourceRoot":"","sources":["../../../src/stripe-client/services/queued-payment-event.handler.ts"],"names":[],"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AAgB,CAAC,mBAAmB,CAAC,CAAA;qCADb,MAAM;QAEiB,UAAU;QACR,+BAA+B;GAP5E,wBAAwB,CAibpC;SAjbY,wBAAwB"}
@@ -1,28 +1,19 @@
1
1
  import Stripe from "stripe";
2
- import { RequestUser } from "../../authorization/models/RequestWithUser.js";
3
2
  import { StripeCheckoutSessionRequestDto } from "../models/StripeCheckoutSessionRequestDto.js";
4
3
  import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto.js";
5
4
  import { StripeClientConfigurationService } from "../StripeClientConfigurationService.js";
6
5
  import { PaymentSessionService } from "../../payment-sessions/payment-session.service.js";
7
- import { StripeCustomerPortalResponseDto } from "../models/StripeCustomerPortalResponseDto.js";
8
- import { StripeCustomerPortalRequestDto } from "../models/StripeCustomerPortalRequestDto.js";
9
6
  import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity.js";
10
7
  import { Repository } from "typeorm";
11
- import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
12
- /**
13
- * Is this doing too much? probably.
14
- */
8
+ import { StripeCustomerPortalResponseDto } from "../models/StripeCustomerPortalResponseDto.js";
15
9
  export declare class StripeCheckoutService {
16
10
  private readonly clientInstance;
17
11
  private readonly stripeClientConfigurationService;
18
12
  private readonly paymentSessionService;
19
- private readonly organisationSubscriptionService;
20
13
  private readonly stripeCheckoutEventRepository;
21
14
  private readonly logger;
22
- constructor(clientInstance: Stripe, stripeClientConfigurationService: StripeClientConfigurationService, paymentSessionService: PaymentSessionService, organisationSubscriptionService: OrganisationSubscriptionService, stripeCheckoutEventRepository: Repository<StripeCheckoutEvent>);
23
- createCustomerPortalSession(parameters: StripeCustomerPortalRequestDto, user: RequestUser): Promise<StripeCustomerPortalResponseDto>;
24
- createAuthenticatedCheckoutSession(parameters: StripeCheckoutSessionRequestDto, user: RequestUser): Promise<StripeCheckoutSessionResponseDto>;
15
+ constructor(clientInstance: Stripe, stripeClientConfigurationService: StripeClientConfigurationService, paymentSessionService: PaymentSessionService, stripeCheckoutEventRepository: Repository<StripeCheckoutEvent>);
25
16
  createCheckoutSession(parameters: StripeCheckoutSessionRequestDto): Promise<StripeCheckoutSessionResponseDto>;
26
- private createStripeSession;
17
+ createStripePortalSession(paymentSystemCustomerId: string, returnUrl: string): Promise<StripeCustomerPortalResponseDto>;
27
18
  getLast(take: number, skip: number): Promise<StripeCheckoutEvent[]>;
28
19
  }
@@ -14,72 +14,29 @@ var StripeCheckoutService_1;
14
14
  /* eslint-disable @typescript-eslint/naming-convention */
15
15
  import { Inject, Injectable, Logger } from "@nestjs/common";
16
16
  import Stripe from "stripe";
17
- import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto.js";
18
17
  import { StripeClientConfigurationService } from "../StripeClientConfigurationService.js";
19
18
  import { PaymentSessionService } from "../../payment-sessions/payment-session.service.js";
20
19
  import { InjectRepository } from "@nestjs/typeorm";
21
20
  import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity.js";
22
21
  import { Repository } from "typeorm";
23
- import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
24
- /**
25
- * Is this doing too much? probably.
26
- */
27
22
  let StripeCheckoutService = StripeCheckoutService_1 = class StripeCheckoutService {
28
23
  clientInstance;
29
24
  stripeClientConfigurationService;
30
25
  paymentSessionService;
31
- organisationSubscriptionService;
32
26
  stripeCheckoutEventRepository;
33
27
  logger = new Logger(StripeCheckoutService_1.name);
34
- constructor(clientInstance, stripeClientConfigurationService, paymentSessionService, organisationSubscriptionService, stripeCheckoutEventRepository) {
28
+ constructor(clientInstance, stripeClientConfigurationService, paymentSessionService, stripeCheckoutEventRepository) {
35
29
  this.clientInstance = clientInstance;
36
30
  this.stripeClientConfigurationService = stripeClientConfigurationService;
37
31
  this.paymentSessionService = paymentSessionService;
38
- this.organisationSubscriptionService = organisationSubscriptionService;
39
32
  this.stripeCheckoutEventRepository = stripeCheckoutEventRepository;
40
33
  }
41
- // must set the org id to the customer id field so we can get this later
42
- async createCustomerPortalSession(parameters, user) {
43
- // is the user a member of the organisation with the subscription record
44
- const subscriptionRecord = await this.organisationSubscriptionService.findOne(parameters.subscriptionRecordUuid);
45
- if (!user.memberships ||
46
- !user.memberships
47
- .map((m) => m.organisation.uuid)
48
- .includes(subscriptionRecord.organisation.uuid)) {
49
- {
50
- throw new Error("You are not a member of the organisation associated with this billing account");
51
- }
52
- }
53
- const session = await this.clientInstance.billingPortal.sessions.create({
54
- customer: subscriptionRecord.paymentSystemCustomerId,
55
- return_url: `${this.stripeClientConfigurationService.stripeRedirectsBaseUrl}${parameters.returnUrl}`,
56
- });
57
- return { sessionUrl: session.url };
58
- }
59
- async createAuthenticatedCheckoutSession(parameters, user) {
60
- // create a new session in the database
61
- const paymentReference = await this.paymentSessionService.createSession({
62
- organisationUuid: parameters.organisationId,
63
- userUuid: user.uuid,
64
- });
65
- const mappedParameters = {
66
- mode: parameters.mode,
67
- client_reference_id: paymentReference.uuid,
68
- line_items: parameters.lineItems,
69
- customer_email: user.email,
70
- success_url: `${this.stripeClientConfigurationService.stripeRedirectsBaseUrl}${parameters.successFrontendPath}`,
71
- cancel_url: parameters.cancelFrontendPath
72
- ? `${this.stripeClientConfigurationService.stripeRedirectsBaseUrl}${parameters.cancelFrontendPath}`
73
- : undefined,
74
- };
75
- return this.createStripeSession(mappedParameters);
76
- }
77
34
  async createCheckoutSession(parameters) {
78
35
  // create a new session in the database
79
36
  const paymentReference = await this.paymentSessionService.createSession({
80
- organisationUuid: parameters.organisationId,
37
+ organisationUuid: parameters.organisationUuid,
81
38
  });
82
- const mappedParameters = {
39
+ const mappedSessionParameters = {
83
40
  mode: parameters.mode,
84
41
  client_reference_id: paymentReference.uuid,
85
42
  line_items: parameters.lineItems,
@@ -88,20 +45,21 @@ let StripeCheckoutService = StripeCheckoutService_1 = class StripeCheckoutServic
88
45
  ? `${this.stripeClientConfigurationService.stripeRedirectsBaseUrl}${parameters.cancelFrontendPath}`
89
46
  : undefined,
90
47
  };
91
- return this.createStripeSession(mappedParameters);
92
- }
93
- async createStripeSession(mappedParameters) {
94
- const session = await this.clientInstance.checkout.sessions.create(mappedParameters);
48
+ const session = await this.clientInstance.checkout.sessions.create(mappedSessionParameters);
95
49
  if (!session.url) {
96
50
  this.logger.error("Failed to create stripe checkout session", {
97
- mappedParameters,
51
+ mappedSessionParameters,
98
52
  });
99
53
  throw new Error("Failed to create checkout session");
100
54
  }
101
- const response = new StripeCheckoutSessionResponseDto();
102
- response.stripeSessionUrl = session.url;
103
- response.stripeSessionId = session.id;
104
- return response;
55
+ return { stripeSessionUrl: session.url, stripeSessionId: session.id };
56
+ }
57
+ async createStripePortalSession(paymentSystemCustomerId, returnUrl) {
58
+ const session = await this.clientInstance.billingPortal.sessions.create({
59
+ customer: paymentSystemCustomerId,
60
+ return_url: `${this.stripeClientConfigurationService.stripeRedirectsBaseUrl}${returnUrl}`,
61
+ });
62
+ return { sessionUrl: session.url };
105
63
  }
106
64
  async getLast(take, skip) {
107
65
  return this.stripeCheckoutEventRepository.find({
@@ -116,11 +74,10 @@ let StripeCheckoutService = StripeCheckoutService_1 = class StripeCheckoutServic
116
74
  StripeCheckoutService = StripeCheckoutService_1 = __decorate([
117
75
  Injectable(),
118
76
  __param(0, Inject("StripeClient")),
119
- __param(4, InjectRepository(StripeCheckoutEvent)),
77
+ __param(3, InjectRepository(StripeCheckoutEvent)),
120
78
  __metadata("design:paramtypes", [Stripe,
121
79
  StripeClientConfigurationService,
122
80
  PaymentSessionService,
123
- OrganisationSubscriptionService,
124
81
  Repository])
125
82
  ], StripeCheckoutService);
126
83
  export { StripeCheckoutService };
@@ -1 +1 @@
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,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC1D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V,IAAI,EAAE,IAAI;YACV,KAAK,EAAE;gBACH,WAAW,EAAE,MAAM;aACtB;SACJ,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAhIY,qBAAqB;IADjC,UAAU,EAAE;IAIJ,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IAKtB,WAAA,gBAAgB,CAAC,mBAAmB,CAAC,CAAA;qCAJL,MAAM;QACY,gCAAgC;QAC3C,qBAAqB;QACX,+BAA+B;QAEjC,UAAU;GATrD,qBAAqB,CAgIjC;SAhIY,qBAAqB"}
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,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAC,gCAAgC,EAAC,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAC,qBAAqB,EAAC,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAI5B,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAIT;IACA;IACA;IAEA;IAPJ,MAAM,GAAG,IAAI,MAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IACjE,YAEqB,cAAsB,EACtB,gCAAkE,EAClE,qBAA4C,EAE5C,6BAA8D;QAJ9D,mBAAc,GAAd,cAAc,CAAQ;QACtB,qCAAgC,GAAhC,gCAAgC,CAAkC;QAClE,0BAAqB,GAArB,qBAAqB,CAAuB;QAE5C,kCAA6B,GAA7B,6BAA6B,CAAiC;IAChF,CAAC;IAEG,KAAK,CAAC,qBAAqB,CAC9B,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