@darraghor/nest-backend-libs 2.23.0 → 2.24.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/authorization/authz.module.js +40 -0
- package/dist/authorization/authz.module.js.map +1 -0
- package/dist/{authz → authorization/config}/AuthConfigurationService.d.ts +1 -1
- package/dist/{authz → authorization/config}/AuthConfigurationService.js +12 -15
- package/dist/authorization/config/AuthConfigurationService.js.map +1 -0
- package/dist/authorization/config/AuthConfigurationVariables.js +6 -0
- package/dist/authorization/config/AuthConfigurationVariables.js.map +1 -0
- package/dist/{authz → authorization/guards}/ApiKeyAuthGuard.js +5 -8
- package/dist/authorization/guards/ApiKeyAuthGuard.js.map +1 -0
- package/dist/{authz → authorization/guards}/ClaimsAuthorisationGuard.js +6 -9
- package/dist/authorization/guards/ClaimsAuthorisationGuard.js.map +1 -0
- package/dist/{authz → authorization/guards}/DefaultAuthGuard.js +5 -8
- package/dist/authorization/guards/DefaultAuthGuard.js.map +1 -0
- package/dist/authorization/guards/MandatoryUserClaims.decorator.js +4 -0
- package/dist/authorization/guards/MandatoryUserClaims.decorator.js.map +1 -0
- package/dist/{authz → authorization}/isOwnerOrThrow.js +3 -7
- package/dist/authorization/isOwnerOrThrow.js.map +1 -0
- package/dist/authorization/models/AccessToken.js +2 -0
- package/dist/authorization/models/AccessToken.js.map +1 -0
- package/dist/{authz → authorization/models}/RequestWithUser.d.ts +1 -1
- package/dist/authorization/models/RequestWithUser.js +2 -0
- package/dist/authorization/models/RequestWithUser.js.map +1 -0
- package/dist/authorization/models/SuperUserClaims.js +6 -0
- package/dist/authorization/models/SuperUserClaims.js.map +1 -0
- package/dist/{authz → authorization/services}/UserValidation.service.d.ts +6 -8
- package/dist/{authz → authorization/services}/UserValidation.service.js +67 -52
- package/dist/authorization/services/UserValidation.service.js.map +1 -0
- package/dist/{authz → authorization/strategies}/apikeystrategy.d.ts +2 -2
- package/dist/{authz → authorization/strategies}/apikeystrategy.js +8 -11
- package/dist/authorization/strategies/apikeystrategy.js.map +1 -0
- package/dist/{authz → authorization/strategies}/authzstrategy.d.ts +4 -4
- package/dist/{authz → authorization/strategies}/authzstrategy.js +15 -18
- package/dist/authorization/strategies/authzstrategy.js.map +1 -0
- package/dist/authzclient/AuthClientConfigurationService.d.ts +1 -1
- package/dist/authzclient/AuthClientConfigurationService.js +10 -13
- package/dist/authzclient/AuthClientConfigurationService.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationVariables.js +2 -4
- package/dist/authzclient/AuthClientConfigurationVariables.js.map +1 -1
- package/dist/authzclient/AuthzClientProvider.d.ts +3 -3
- package/dist/authzclient/AuthzClientProvider.js +6 -8
- package/dist/authzclient/AuthzClientProvider.js.map +1 -1
- package/dist/authzclient/UserProfile.dto.js +1 -5
- package/dist/authzclient/UserProfile.dto.js.map +1 -1
- package/dist/authzclient/authz-client.module.js +13 -19
- package/dist/authzclient/authz-client.module.js.map +1 -1
- package/dist/authzclient/authz.service.d.ts +2 -2
- package/dist/authzclient/authz.service.js +6 -10
- package/dist/authzclient/authz.service.js.map +1 -1
- package/dist/cli/cli.js +4 -29
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/commands/WriteApiClientCommand.js +6 -13
- package/dist/cli/commands/WriteApiClientCommand.js.map +1 -1
- package/dist/configuration/ValidatedConfigurationService.js +5 -8
- package/dist/configuration/ValidatedConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfig.module.js +9 -15
- package/dist/core-config/CoreConfig.module.js.map +1 -1
- package/dist/core-config/CoreConfigurationService.d.ts +2 -1
- package/dist/core-config/CoreConfigurationService.js +33 -27
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfigurationVariables.d.ts +2 -0
- package/dist/core-config/CoreConfigurationVariables.js +3 -4
- package/dist/core-config/CoreConfigurationVariables.js.map +1 -1
- package/dist/database-postgres/PostgresDatabase.module.js +11 -14
- package/dist/database-postgres/PostgresDatabase.module.js.map +1 -1
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js +5 -8
- package/dist/database-postgres/PostgresDatabaseConfigurationService.js.map +1 -1
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js +7 -13
- package/dist/database-postgres/PostgresTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/database-postgres/PostrgresMigrationsHelper.js +6 -11
- package/dist/database-postgres/PostrgresMigrationsHelper.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabase.module.js +11 -14
- package/dist/database-sqlite/SqliteDatabase.module.js.map +1 -1
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js +5 -8
- package/dist/database-sqlite/SqliteDatabaseConfigurationService.js.map +1 -1
- package/dist/database-sqlite/SqliteMigrationsHelper.js +6 -11
- package/dist/database-sqlite/SqliteMigrationsHelper.js.map +1 -1
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js +8 -14
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/health/Health.controller.js +15 -18
- package/dist/health/Health.controller.js.map +1 -1
- package/dist/health/Health.module.js +8 -11
- package/dist/health/Health.module.js.map +1 -1
- package/dist/index.d.ts +48 -24
- package/dist/index.js +54 -58
- package/dist/index.js.map +1 -1
- package/dist/invitations/InvitationConfigurationService.d.ts +1 -1
- package/dist/invitations/InvitationConfigurationService.js +10 -13
- package/dist/invitations/InvitationConfigurationService.js.map +1 -1
- package/dist/invitations/InvitationConfigurationVariables.js +2 -4
- package/dist/invitations/InvitationConfigurationVariables.js.map +1 -1
- package/dist/invitations/dto/create-invitation.dto.js +5 -9
- package/dist/invitations/dto/create-invitation.dto.js.map +1 -1
- package/dist/invitations/entities/invitation.entity.d.ts +3 -2
- package/dist/invitations/entities/invitation.entity.js +33 -36
- package/dist/invitations/entities/invitation.entity.js.map +1 -1
- package/dist/invitations/invitation.controller.d.ts +4 -4
- package/dist/invitations/invitation.controller.js +21 -24
- package/dist/invitations/invitation.controller.js.map +1 -1
- package/dist/invitations/invitation.module.js +21 -27
- package/dist/invitations/invitation.module.js.map +1 -1
- package/dist/invitations/invitation.service.d.ts +7 -7
- package/dist/invitations/invitation.service.js +34 -37
- package/dist/invitations/invitation.service.js.map +1 -1
- package/dist/logger/LoggingConfigurationService.d.ts +1 -1
- package/dist/logger/LoggingConfigurationService.js +16 -19
- package/dist/logger/LoggingConfigurationService.js.map +1 -1
- package/dist/logger/LoggingConfigurationVariables.js +2 -4
- package/dist/logger/LoggingConfigurationVariables.js.map +1 -1
- package/dist/logger/logger.module.js +10 -16
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/organisation/dto/RolesEnum.js +2 -5
- package/dist/organisation/dto/RolesEnum.js.map +1 -1
- package/dist/organisation/dto/create-organisation.dto.d.ts +1 -1
- package/dist/organisation/dto/create-organisation.dto.js +7 -11
- package/dist/organisation/dto/create-organisation.dto.js.map +1 -1
- package/dist/organisation/dto/update-organisation.dto.d.ts +1 -1
- package/dist/organisation/dto/update-organisation.dto.js +3 -7
- package/dist/organisation/dto/update-organisation.dto.js.map +1 -1
- package/dist/organisation/entities/member-role.entity.d.ts +3 -2
- package/dist/organisation/entities/member-role.entity.js +20 -23
- package/dist/organisation/entities/member-role.entity.js.map +1 -1
- package/dist/organisation/entities/organisation.entity.d.ts +2 -2
- package/dist/organisation/entities/organisation.entity.js +28 -31
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/organisation/organisation.controller.d.ts +5 -5
- package/dist/organisation/organisation.controller.js +30 -33
- package/dist/organisation/organisation.controller.js.map +1 -1
- package/dist/organisation/organisation.module.js +18 -21
- package/dist/organisation/organisation.module.js.map +1 -1
- package/dist/organisation/organisation.service.d.ts +3 -3
- package/dist/organisation/organisation.service.js +21 -24
- package/dist/organisation/organisation.service.js.map +1 -1
- package/dist/organisation-memberships/dtos/create-membership-dto.js +4 -8
- package/dist/organisation-memberships/dtos/create-membership-dto.js.map +1 -1
- package/dist/organisation-memberships/entities/organisation-membership.entity.d.ts +4 -4
- package/dist/organisation-memberships/entities/organisation-membership.entity.js +40 -43
- package/dist/organisation-memberships/entities/organisation-membership.entity.js.map +1 -1
- package/dist/organisation-memberships/organisation-memberships.controller.d.ts +6 -6
- package/dist/organisation-memberships/organisation-memberships.controller.js +29 -32
- package/dist/organisation-memberships/organisation-memberships.controller.js.map +1 -1
- package/dist/organisation-memberships/organisation-memberships.module.js +16 -19
- package/dist/organisation-memberships/organisation-memberships.module.js.map +1 -1
- package/dist/organisation-memberships/organisation-memberships.service.d.ts +3 -3
- package/dist/organisation-memberships/organisation-memberships.service.js +20 -23
- package/dist/organisation-memberships/organisation-memberships.service.js.map +1 -1
- package/dist/organisation-subscriptions/all-subscriptions.controller.d.ts +2 -2
- package/dist/organisation-subscriptions/all-subscriptions.controller.js +16 -17
- package/dist/organisation-subscriptions/all-subscriptions.controller.js.map +1 -1
- package/dist/organisation-subscriptions/entities/organisation-subscription.entity.d.ts +3 -2
- package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js +40 -43
- package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js.map +1 -1
- package/dist/organisation-subscriptions/models/fulfillSubscriptionDto.js +25 -29
- package/dist/organisation-subscriptions/models/fulfillSubscriptionDto.js.map +1 -1
- package/dist/organisation-subscriptions/organisation-subscriptions.controller.d.ts +5 -5
- package/dist/organisation-subscriptions/organisation-subscriptions.controller.js +27 -31
- package/dist/organisation-subscriptions/organisation-subscriptions.controller.js.map +1 -1
- package/dist/organisation-subscriptions/organisation-subscriptions.module.js +18 -21
- package/dist/organisation-subscriptions/organisation-subscriptions.module.js.map +1 -1
- package/dist/organisation-subscriptions/organisation-subscriptions.service.d.ts +4 -4
- package/dist/organisation-subscriptions/organisation-subscriptions.service.js +21 -24
- package/dist/organisation-subscriptions/organisation-subscriptions.service.js.map +1 -1
- package/dist/payment-sessions/payment-session.controller.d.ts +3 -3
- package/dist/payment-sessions/payment-session.controller.js +17 -18
- package/dist/payment-sessions/payment-session.controller.js.map +1 -1
- package/dist/payment-sessions/payment-session.entity.js +14 -17
- package/dist/payment-sessions/payment-session.entity.js.map +1 -1
- package/dist/payment-sessions/payment-session.module.js +11 -14
- package/dist/payment-sessions/payment-session.module.js.map +1 -1
- package/dist/payment-sessions/payment-session.service.d.ts +1 -1
- package/dist/payment-sessions/payment-session.service.js +8 -11
- package/dist/payment-sessions/payment-session.service.js.map +1 -1
- package/dist/root-app/SwaggerGen.d.ts +1 -1
- package/dist/root-app/SwaggerGen.js +14 -20
- package/dist/root-app/SwaggerGen.js.map +1 -1
- package/dist/root-app/app.controller.d.ts +2 -2
- package/dist/root-app/app.controller.js +16 -19
- package/dist/root-app/app.controller.js.map +1 -1
- package/dist/root-app/app.service.js +3 -6
- package/dist/root-app/app.service.js.map +1 -1
- package/dist/root-app/core-app.module.js +51 -45
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/root-app/models/QueueItemDto.js +7 -11
- package/dist/root-app/models/QueueItemDto.js.map +1 -1
- package/dist/root-app/models/boolean-result.js +3 -7
- package/dist/root-app/models/boolean-result.js.map +1 -1
- package/dist/root-app/notfound.interceptor.js +6 -9
- package/dist/root-app/notfound.interceptor.js.map +1 -1
- package/dist/runningCommandLine/CliCommandService.js +7 -13
- package/dist/runningCommandLine/CliCommandService.js.map +1 -1
- package/dist/runningCommandLine/RunningCommandLine.module.js +7 -10
- package/dist/runningCommandLine/RunningCommandLine.module.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.d.ts +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.js +24 -27
- package/dist/smtp-email-client/EmailConfigurationService.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.js +2 -4
- package/dist/smtp-email-client/EmailConfigurationVariables.js.map +1 -1
- package/dist/smtp-email-client/EmailTransporterProvider.d.ts +1 -1
- package/dist/smtp-email-client/EmailTransporterProvider.js +5 -8
- package/dist/smtp-email-client/EmailTransporterProvider.js.map +1 -1
- package/dist/smtp-email-client/email-client.service.d.ts +2 -2
- package/dist/smtp-email-client/email-client.service.js +13 -16
- package/dist/smtp-email-client/email-client.service.js.map +1 -1
- package/dist/smtp-email-client/email.controller.d.ts +3 -3
- package/dist/smtp-email-client/email.controller.js +24 -25
- package/dist/smtp-email-client/email.controller.js.map +1 -1
- package/dist/smtp-email-client/email.entity.js +32 -35
- package/dist/smtp-email-client/email.entity.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.js +22 -28
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-handler.d.ts +2 -2
- package/dist/smtp-email-client/smtp-email-handler.js +18 -21
- package/dist/smtp-email-client/smtp-email-handler.js.map +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.d.ts +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.js +14 -17
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/StripeClientProvider.d.ts +1 -1
- package/dist/stripe-client/StripeClientProvider.js +5 -11
- package/dist/stripe-client/StripeClientProvider.js.map +1 -1
- package/dist/stripe-client/StripeConfigurationVariables.js +2 -4
- package/dist/stripe-client/StripeConfigurationVariables.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-checkout-controller.d.ts +4 -4
- package/dist/stripe-client/controllers/stripe-checkout-controller.js +17 -20
- package/dist/stripe-client/controllers/stripe-checkout-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-customer-portal-controller.d.ts +4 -4
- package/dist/stripe-client/controllers/stripe-customer-portal-controller.js +18 -21
- package/dist/stripe-client/controllers/stripe-customer-portal-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-events-controller.d.ts +3 -3
- package/dist/stripe-client/controllers/stripe-events-controller.js +20 -21
- package/dist/stripe-client/controllers/stripe-events-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.d.ts +3 -3
- package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.js +13 -16
- package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-webhook-controller.d.ts +2 -2
- package/dist/stripe-client/controllers/stripe-webhook-controller.js +27 -28
- package/dist/stripe-client/controllers/stripe-webhook-controller.js.map +1 -1
- package/dist/stripe-client/entities/stripe-checkout-event.entity.js +19 -22
- package/dist/stripe-client/entities/stripe-checkout-event.entity.js.map +1 -1
- package/dist/stripe-client/models/StripeCheckoutLineItem.js +7 -11
- package/dist/stripe-client/models/StripeCheckoutLineItem.js.map +1 -1
- package/dist/stripe-client/models/StripeCheckoutSessionRequestDto.d.ts +1 -1
- package/dist/stripe-client/models/StripeCheckoutSessionRequestDto.js +17 -21
- package/dist/stripe-client/models/StripeCheckoutSessionRequestDto.js.map +1 -1
- package/dist/stripe-client/models/StripeCheckoutSessionResponseDto.js +4 -8
- package/dist/stripe-client/models/StripeCheckoutSessionResponseDto.js.map +1 -1
- package/dist/stripe-client/models/StripeCustomerPortalRequestDto.js +9 -13
- package/dist/stripe-client/models/StripeCustomerPortalRequestDto.js.map +1 -1
- package/dist/stripe-client/models/StripeCustomerPortalResponseDto.js +3 -7
- package/dist/stripe-client/models/StripeCustomerPortalResponseDto.js.map +1 -1
- package/dist/stripe-client/models/UrlResponseDto.js +1 -5
- package/dist/stripe-client/models/UrlResponseDto.js.map +1 -1
- package/dist/stripe-client/services/queued-payment-event.handler.d.ts +3 -3
- package/dist/stripe-client/services/queued-payment-event.handler.js +22 -28
- package/dist/stripe-client/services/queued-payment-event.handler.js.map +1 -1
- package/dist/stripe-client/services/stripe-checkout.service.d.ts +9 -9
- package/dist/stripe-client/services/stripe-checkout.service.js +20 -26
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/services/stripe-webhook-handler.service.d.ts +1 -1
- package/dist/stripe-client/services/stripe-webhook-handler.service.js +12 -18
- package/dist/stripe-client/services/stripe-webhook-handler.service.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.js +37 -43
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/testing/preRun.js +1 -3
- package/dist/testing/preRun.js.map +1 -1
- package/dist/twitter-client/TwitterClientConfigurationService.d.ts +1 -1
- package/dist/twitter-client/TwitterClientConfigurationService.js +16 -19
- package/dist/twitter-client/TwitterClientConfigurationService.js.map +1 -1
- package/dist/twitter-client/TwitterClientProvider.d.ts +2 -2
- package/dist/twitter-client/TwitterClientProvider.js +5 -8
- package/dist/twitter-client/TwitterClientProvider.js.map +1 -1
- package/dist/twitter-client/TwitterConfigurationVariables.js +2 -4
- package/dist/twitter-client/TwitterConfigurationVariables.js.map +1 -1
- package/dist/twitter-client/services/twitter-client.service.d.ts +1 -1
- package/dist/twitter-client/services/twitter-client.service.js +6 -10
- package/dist/twitter-client/services/twitter-client.service.js.map +1 -1
- package/dist/twitter-client/twitter-account.module.js +14 -20
- package/dist/twitter-client/twitter-account.module.js.map +1 -1
- package/dist/user-api-key/CreateApiKeyDto.js +6 -9
- package/dist/user-api-key/CreateApiKeyDto.js.map +1 -1
- package/dist/user-api-key/user-apikey.controller.d.ts +5 -5
- package/dist/user-api-key/user-apikey.controller.js +30 -35
- package/dist/user-api-key/user-apikey.controller.js.map +1 -1
- package/dist/user-api-key/user-apikey.module.js +11 -14
- package/dist/user-api-key/user-apikey.module.js.map +1 -1
- package/dist/user-api-key/user-apikey.service.d.ts +1 -1
- package/dist/user-api-key/user-apikey.service.js +14 -17
- package/dist/user-api-key/user-apikey.service.js.map +1 -1
- package/dist/user-api-key/userApiKey.entity.d.ts +3 -2
- package/dist/user-api-key/userApiKey.entity.js +22 -25
- package/dist/user-api-key/userApiKey.entity.js.map +1 -1
- package/dist/user-internal/dto/create-user.dto.js +1 -5
- package/dist/user-internal/dto/create-user.dto.js.map +1 -1
- package/dist/user-internal/dto/update-user.dto.d.ts +1 -1
- package/dist/user-internal/dto/update-user.dto.js +3 -7
- package/dist/user-internal/dto/update-user.dto.js.map +1 -1
- package/dist/user-internal/dto/userResponseDto.d.ts +1 -1
- package/dist/user-internal/dto/userResponseDto.js +21 -25
- package/dist/user-internal/dto/userResponseDto.js.map +1 -1
- package/dist/user-internal/entities/user.entity.d.ts +2 -2
- package/dist/user-internal/entities/user.entity.js +47 -50
- package/dist/user-internal/entities/user.entity.js.map +1 -1
- package/dist/user-internal/user-internal.module.js +11 -13
- package/dist/user-internal/user-internal.module.js.map +1 -1
- package/dist/{user-external → user-internal}/user.controller.d.ts +6 -6
- package/dist/{user-external → user-internal}/user.controller.js +38 -38
- package/dist/user-internal/user.controller.js.map +1 -0
- package/dist/user-internal/user.service.d.ts +3 -3
- package/dist/user-internal/user.service.js +12 -15
- package/dist/user-internal/user.service.js.map +1 -1
- package/package.json +8 -2
- package/dist/authz/AccessToken.js +0 -3
- package/dist/authz/AccessToken.js.map +0 -1
- package/dist/authz/ApiKeyAuthGuard.js.map +0 -1
- package/dist/authz/AuthConfigurationService.js.map +0 -1
- package/dist/authz/AuthConfigurationVariables.js +0 -8
- package/dist/authz/AuthConfigurationVariables.js.map +0 -1
- package/dist/authz/ClaimsAuthorisationGuard.js.map +0 -1
- package/dist/authz/DefaultAuthGuard.js.map +0 -1
- package/dist/authz/MandatoryUserClaims.decorator.js +0 -8
- package/dist/authz/MandatoryUserClaims.decorator.js.map +0 -1
- package/dist/authz/RequestWithUser.js +0 -3
- package/dist/authz/RequestWithUser.js.map +0 -1
- package/dist/authz/SuperUserClaims.js +0 -9
- package/dist/authz/SuperUserClaims.js.map +0 -1
- package/dist/authz/UserValidation.service.js.map +0 -1
- package/dist/authz/apikeystrategy.js.map +0 -1
- package/dist/authz/authz.module.js +0 -48
- package/dist/authz/authz.module.js.map +0 -1
- package/dist/authz/authzstrategy.js.map +0 -1
- package/dist/authz/index.d.ts +0 -10
- package/dist/authz/index.js +0 -22
- package/dist/authz/index.js.map +0 -1
- package/dist/authz/isOwnerOrThrow.js.map +0 -1
- package/dist/invitations/index.d.ts +0 -4
- package/dist/invitations/index.js +0 -12
- package/dist/invitations/index.js.map +0 -1
- package/dist/organisation/index.d.ts +0 -1
- package/dist/organisation/index.js +0 -6
- package/dist/organisation/index.js.map +0 -1
- package/dist/organisation-memberships/index.d.ts +0 -2
- package/dist/organisation-memberships/index.js +0 -8
- package/dist/organisation-memberships/index.js.map +0 -1
- package/dist/organisation-subscriptions/index.d.ts +0 -3
- package/dist/organisation-subscriptions/index.js +0 -10
- package/dist/organisation-subscriptions/index.js.map +0 -1
- package/dist/stripe-client/index.d.ts +0 -7
- package/dist/stripe-client/index.js +0 -18
- package/dist/stripe-client/index.js.map +0 -1
- package/dist/user-api-key/index.d.ts +0 -3
- package/dist/user-api-key/index.js +0 -10
- package/dist/user-api-key/index.js.map +0 -1
- package/dist/user-external/index.d.ts +0 -1
- package/dist/user-external/index.js +0 -6
- package/dist/user-external/index.js.map +0 -1
- package/dist/user-external/user-external.module.d.ts +0 -2
- package/dist/user-external/user-external.module.js +0 -24
- package/dist/user-external/user-external.module.js.map +0 -1
- package/dist/user-external/user.controller.js.map +0 -1
- package/dist/user-internal/index.d.ts +0 -2
- package/dist/user-internal/index.js +0 -8
- package/dist/user-internal/index.js.map +0 -1
- /package/dist/{authz → authorization}/authz.module.d.ts +0 -0
- /package/dist/{authz → authorization/config}/AuthConfigurationVariables.d.ts +0 -0
- /package/dist/{authz → authorization/guards}/ApiKeyAuthGuard.d.ts +0 -0
- /package/dist/{authz → authorization/guards}/ClaimsAuthorisationGuard.d.ts +0 -0
- /package/dist/{authz → authorization/guards}/DefaultAuthGuard.d.ts +0 -0
- /package/dist/{authz → authorization/guards}/MandatoryUserClaims.decorator.d.ts +0 -0
- /package/dist/{authz → authorization}/isOwnerOrThrow.d.ts +0 -0
- /package/dist/{authz → authorization/models}/AccessToken.d.ts +0 -0
- /package/dist/{authz → authorization/models}/SuperUserClaims.d.ts +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,20 +7,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
class StripeCheckoutSessionResponseDto {
|
|
10
|
+
import { ApiProperty } from "@nestjs/swagger";
|
|
11
|
+
export class StripeCheckoutSessionResponseDto {
|
|
15
12
|
stripeSessionId;
|
|
16
13
|
stripeSessionUrl;
|
|
17
14
|
}
|
|
18
15
|
__decorate([
|
|
19
|
-
|
|
16
|
+
ApiProperty(),
|
|
20
17
|
__metadata("design:type", String)
|
|
21
18
|
], StripeCheckoutSessionResponseDto.prototype, "stripeSessionId", void 0);
|
|
22
19
|
__decorate([
|
|
23
|
-
|
|
20
|
+
ApiProperty(),
|
|
24
21
|
__metadata("design:type", String)
|
|
25
22
|
], StripeCheckoutSessionResponseDto.prototype, "stripeSessionUrl", void 0);
|
|
26
|
-
exports.StripeCheckoutSessionResponseDto = StripeCheckoutSessionResponseDto;
|
|
27
23
|
//# sourceMappingURL=StripeCheckoutSessionResponseDto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeCheckoutSessionResponseDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionResponseDto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeCheckoutSessionResponseDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCheckoutSessionResponseDto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,gCAAgC;IAEzC,eAAe,CAAU;IAGzB,gBAAgB,CAAU;CAC7B;AALG;IAAC,WAAW,EAAE;;yEACW;AAEzB;IAAC,WAAW,EAAE;;0EACY"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,25 +7,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const class_validator_1 = require("class-validator");
|
|
15
|
-
class StripeCustomerPortalRequestDto {
|
|
10
|
+
import { ApiProperty } from "@nestjs/swagger";
|
|
11
|
+
import { IsDefined, IsString } from "class-validator";
|
|
12
|
+
export class StripeCustomerPortalRequestDto {
|
|
16
13
|
subscriptionRecordUuid;
|
|
17
14
|
returnUrl;
|
|
18
15
|
}
|
|
19
16
|
__decorate([
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
ApiProperty(),
|
|
18
|
+
IsString(),
|
|
19
|
+
IsDefined(),
|
|
23
20
|
__metadata("design:type", String)
|
|
24
21
|
], StripeCustomerPortalRequestDto.prototype, "subscriptionRecordUuid", void 0);
|
|
25
22
|
__decorate([
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
ApiProperty(),
|
|
24
|
+
IsString(),
|
|
25
|
+
IsDefined(),
|
|
29
26
|
__metadata("design:type", String)
|
|
30
27
|
], StripeCustomerPortalRequestDto.prototype, "returnUrl", void 0);
|
|
31
|
-
exports.StripeCustomerPortalRequestDto = StripeCustomerPortalRequestDto;
|
|
32
28
|
//# sourceMappingURL=StripeCustomerPortalRequestDto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeCustomerPortalRequestDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCustomerPortalRequestDto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeCustomerPortalRequestDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCustomerPortalRequestDto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAEpD,MAAM,OAAO,8BAA8B;IAIhC,sBAAsB,CAAU;IAKhC,SAAS,CAAU;CAC7B;AATG;IAAC,WAAW,EAAE;IACb,QAAQ,EAAE;IACV,SAAS,EAAE;;8EAC2B;AAEvC;IAAC,WAAW,EAAE;IACb,QAAQ,EAAE;IACV,SAAS,EAAE;;iEACc"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,15 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
class StripeCustomerPortalResponseDto {
|
|
10
|
+
import { ApiProperty } from "@nestjs/swagger";
|
|
11
|
+
export class StripeCustomerPortalResponseDto {
|
|
15
12
|
sessionUrl;
|
|
16
13
|
}
|
|
17
14
|
__decorate([
|
|
18
|
-
|
|
15
|
+
ApiProperty(),
|
|
19
16
|
__metadata("design:type", String)
|
|
20
17
|
], StripeCustomerPortalResponseDto.prototype, "sessionUrl", void 0);
|
|
21
|
-
exports.StripeCustomerPortalResponseDto = StripeCustomerPortalResponseDto;
|
|
22
18
|
//# sourceMappingURL=StripeCustomerPortalResponseDto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeCustomerPortalResponseDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCustomerPortalResponseDto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeCustomerPortalResponseDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/StripeCustomerPortalResponseDto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,+BAA+B;IAEjC,UAAU,CAAU;CAC9B;AAFG;IAAC,WAAW,EAAE;;mEACa"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UrlResponseDto = void 0;
|
|
4
|
-
class UrlResponseDto {
|
|
1
|
+
export class UrlResponseDto {
|
|
5
2
|
url;
|
|
6
3
|
}
|
|
7
|
-
exports.UrlResponseDto = UrlResponseDto;
|
|
8
4
|
//# sourceMappingURL=UrlResponseDto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlResponseDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/UrlResponseDto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UrlResponseDto.js","sourceRoot":"","sources":["../../../src/stripe-client/models/UrlResponseDto.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAc;IACvB,GAAG,CAAU;CAChB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Job } from "bull";
|
|
2
2
|
import Stripe from "stripe";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity";
|
|
3
|
+
import { SaveOrganisationSubscriptionRecordDto } from "../../organisation-subscriptions/models/fulfillSubscriptionDto.js";
|
|
4
|
+
import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity.js";
|
|
6
5
|
import { Repository } from "typeorm";
|
|
6
|
+
import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
|
|
7
7
|
export declare class StripeQueuedEventHandler {
|
|
8
8
|
private readonly stripe;
|
|
9
9
|
private readonly stripeCheckoutEventRepository;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,28 +10,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
13
|
var StripeQueuedEventHandler_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.StripeQueuedEventHandler = void 0;
|
|
20
14
|
/* eslint-disable sonarjs/no-duplicate-string */
|
|
21
15
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
22
16
|
/* eslint-disable sonarjs/no-duplicated-branches */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
import { Inject, Injectable, Logger } from "@nestjs/common";
|
|
18
|
+
import { OnQueueActive, OnQueueCompleted, OnQueueFailed, Process, Processor, } from "@nestjs/bull";
|
|
19
|
+
import Stripe from "stripe";
|
|
20
|
+
import { SaveOrganisationSubscriptionRecordDto } from "../../organisation-subscriptions/models/fulfillSubscriptionDto.js";
|
|
21
|
+
import { InjectRepository } from "@nestjs/typeorm";
|
|
22
|
+
import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity.js";
|
|
23
|
+
import { Repository } from "typeorm";
|
|
24
|
+
import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
|
|
31
25
|
let StripeQueuedEventHandler = StripeQueuedEventHandler_1 = class StripeQueuedEventHandler {
|
|
32
26
|
stripe;
|
|
33
27
|
stripeCheckoutEventRepository;
|
|
34
28
|
organisationSubscriptionService;
|
|
35
|
-
logger = new
|
|
29
|
+
logger = new Logger(StripeQueuedEventHandler_1.name);
|
|
36
30
|
constructor(stripe, stripeCheckoutEventRepository, organisationSubscriptionService) {
|
|
37
31
|
this.stripe = stripe;
|
|
38
32
|
this.stripeCheckoutEventRepository = stripeCheckoutEventRepository;
|
|
@@ -74,7 +68,7 @@ let StripeQueuedEventHandler = StripeQueuedEventHandler_1 = class StripeQueuedEv
|
|
|
74
68
|
return subs;
|
|
75
69
|
}
|
|
76
70
|
stripeFulfillmentDtoFactory(product, customer, altEmail, altEmail2) {
|
|
77
|
-
const subscriptionFulfilmentDto = new
|
|
71
|
+
const subscriptionFulfilmentDto = new SaveOrganisationSubscriptionRecordDto();
|
|
78
72
|
subscriptionFulfilmentDto.paymentSystemName = "stripe";
|
|
79
73
|
subscriptionFulfilmentDto.paymentSystemProductId = product?.id;
|
|
80
74
|
subscriptionFulfilmentDto.productDisplayName = product.name;
|
|
@@ -316,13 +310,13 @@ let StripeQueuedEventHandler = StripeQueuedEventHandler_1 = class StripeQueuedEv
|
|
|
316
310
|
}
|
|
317
311
|
};
|
|
318
312
|
__decorate([
|
|
319
|
-
|
|
313
|
+
OnQueueFailed(),
|
|
320
314
|
__metadata("design:type", Function),
|
|
321
315
|
__metadata("design:paramtypes", [Object, Error]),
|
|
322
316
|
__metadata("design:returntype", void 0)
|
|
323
317
|
], StripeQueuedEventHandler.prototype, "onError", null);
|
|
324
318
|
__decorate([
|
|
325
|
-
|
|
319
|
+
OnQueueActive()
|
|
326
320
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
327
321
|
,
|
|
328
322
|
__metadata("design:type", Function),
|
|
@@ -330,7 +324,7 @@ __decorate([
|
|
|
330
324
|
__metadata("design:returntype", void 0)
|
|
331
325
|
], StripeQueuedEventHandler.prototype, "onActive", null);
|
|
332
326
|
__decorate([
|
|
333
|
-
|
|
327
|
+
OnQueueCompleted()
|
|
334
328
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
335
329
|
,
|
|
336
330
|
__metadata("design:type", Function),
|
|
@@ -338,23 +332,23 @@ __decorate([
|
|
|
338
332
|
__metadata("design:returntype", void 0)
|
|
339
333
|
], StripeQueuedEventHandler.prototype, "onComplete", null);
|
|
340
334
|
__decorate([
|
|
341
|
-
|
|
335
|
+
Process(),
|
|
342
336
|
__metadata("design:type", Function),
|
|
343
337
|
__metadata("design:paramtypes", [Object]),
|
|
344
338
|
__metadata("design:returntype", Promise)
|
|
345
339
|
], StripeQueuedEventHandler.prototype, "handleEvent", null);
|
|
346
340
|
StripeQueuedEventHandler = StripeQueuedEventHandler_1 = __decorate([
|
|
347
|
-
|
|
348
|
-
|
|
341
|
+
Injectable(),
|
|
342
|
+
Processor("stripe-events")
|
|
349
343
|
// This is just an example with notes. You should create your own handler
|
|
350
344
|
//
|
|
351
345
|
// eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
|
|
352
346
|
,
|
|
353
|
-
__param(0,
|
|
354
|
-
__param(1,
|
|
355
|
-
__metadata("design:paramtypes", [
|
|
356
|
-
|
|
357
|
-
|
|
347
|
+
__param(0, Inject("StripeClient")),
|
|
348
|
+
__param(1, InjectRepository(StripeCheckoutEvent)),
|
|
349
|
+
__metadata("design:paramtypes", [Stripe,
|
|
350
|
+
Repository,
|
|
351
|
+
OrganisationSubscriptionService])
|
|
358
352
|
], StripeQueuedEventHandler);
|
|
359
|
-
|
|
353
|
+
export { StripeQueuedEventHandler };
|
|
360
354
|
//# sourceMappingURL=queued-payment-event.handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queued-payment-event.handler.js","sourceRoot":"","sources":["../../../src/stripe-client/services/queued-payment-event.handler.ts"],"names":[],"mappings":"
|
|
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,EACH,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,SAAS,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,qCAAqC,EAAC,MAAM,mEAAmE,CAAC;AACxH,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,+BAA+B,EAAC,MAAM,wEAAwE,CAAC;AAOhH,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;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C;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,14 +1,14 @@
|
|
|
1
1
|
import Stripe from "stripe";
|
|
2
|
-
import { RequestUser } from "../../
|
|
3
|
-
import { StripeCheckoutSessionRequestDto } from "../models/StripeCheckoutSessionRequestDto";
|
|
4
|
-
import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto";
|
|
5
|
-
import { StripeClientConfigurationService } from "../StripeClientConfigurationService";
|
|
6
|
-
import { PaymentSessionService } from "../../payment-sessions/payment-session.service";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity";
|
|
2
|
+
import { RequestUser } from "../../authorization/models/RequestWithUser.js";
|
|
3
|
+
import { StripeCheckoutSessionRequestDto } from "../models/StripeCheckoutSessionRequestDto.js";
|
|
4
|
+
import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto.js";
|
|
5
|
+
import { StripeClientConfigurationService } from "../StripeClientConfigurationService.js";
|
|
6
|
+
import { PaymentSessionService } from "../../payment-sessions/payment-session.service.js";
|
|
7
|
+
import { StripeCustomerPortalResponseDto } from "../models/StripeCustomerPortalResponseDto.js";
|
|
8
|
+
import { StripeCustomerPortalRequestDto } from "../models/StripeCustomerPortalRequestDto.js";
|
|
9
|
+
import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity.js";
|
|
11
10
|
import { Repository } from "typeorm";
|
|
11
|
+
import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
|
|
12
12
|
/**
|
|
13
13
|
* Is this doing too much? probably.
|
|
14
14
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,22 +10,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
13
|
var StripeCheckoutService_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.StripeCheckoutService = void 0;
|
|
20
14
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
import { Inject, Injectable, Logger } from "@nestjs/common";
|
|
16
|
+
import Stripe from "stripe";
|
|
17
|
+
import { StripeCheckoutSessionResponseDto } from "../models/StripeCheckoutSessionResponseDto.js";
|
|
18
|
+
import { StripeClientConfigurationService } from "../StripeClientConfigurationService.js";
|
|
19
|
+
import { PaymentSessionService } from "../../payment-sessions/payment-session.service.js";
|
|
20
|
+
import { InjectRepository } from "@nestjs/typeorm";
|
|
21
|
+
import { StripeCheckoutEvent } from "../entities/stripe-checkout-event.entity.js";
|
|
22
|
+
import { Repository } from "typeorm";
|
|
23
|
+
import { OrganisationSubscriptionService } from "../../organisation-subscriptions/organisation-subscriptions.service.js";
|
|
30
24
|
/**
|
|
31
25
|
* Is this doing too much? probably.
|
|
32
26
|
*/
|
|
@@ -36,7 +30,7 @@ let StripeCheckoutService = StripeCheckoutService_1 = class StripeCheckoutServic
|
|
|
36
30
|
paymentSessionService;
|
|
37
31
|
organisationSubscriptionService;
|
|
38
32
|
stripeCheckoutEventRepository;
|
|
39
|
-
logger = new
|
|
33
|
+
logger = new Logger(StripeCheckoutService_1.name);
|
|
40
34
|
constructor(clientInstance, stripeClientConfigurationService, paymentSessionService, organisationSubscriptionService, stripeCheckoutEventRepository) {
|
|
41
35
|
this.clientInstance = clientInstance;
|
|
42
36
|
this.stripeClientConfigurationService = stripeClientConfigurationService;
|
|
@@ -103,7 +97,7 @@ let StripeCheckoutService = StripeCheckoutService_1 = class StripeCheckoutServic
|
|
|
103
97
|
});
|
|
104
98
|
throw new Error("Failed to create checkout session");
|
|
105
99
|
}
|
|
106
|
-
const response = new
|
|
100
|
+
const response = new StripeCheckoutSessionResponseDto();
|
|
107
101
|
response.stripeSessionUrl = session.url;
|
|
108
102
|
response.stripeSessionId = session.id;
|
|
109
103
|
return response;
|
|
@@ -119,14 +113,14 @@ let StripeCheckoutService = StripeCheckoutService_1 = class StripeCheckoutServic
|
|
|
119
113
|
}
|
|
120
114
|
};
|
|
121
115
|
StripeCheckoutService = StripeCheckoutService_1 = __decorate([
|
|
122
|
-
|
|
123
|
-
__param(0,
|
|
124
|
-
__param(4,
|
|
125
|
-
__metadata("design:paramtypes", [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
116
|
+
Injectable(),
|
|
117
|
+
__param(0, Inject("StripeClient")),
|
|
118
|
+
__param(4, InjectRepository(StripeCheckoutEvent)),
|
|
119
|
+
__metadata("design:paramtypes", [Stripe,
|
|
120
|
+
StripeClientConfigurationService,
|
|
121
|
+
PaymentSessionService,
|
|
122
|
+
OrganisationSubscriptionService,
|
|
123
|
+
Repository])
|
|
130
124
|
], StripeCheckoutService);
|
|
131
|
-
|
|
125
|
+
export { StripeCheckoutService };
|
|
132
126
|
//# sourceMappingURL=stripe-checkout.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-checkout.service.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-checkout.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stripe-checkout.service.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-checkout.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAyD;AACzD,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAC,gCAAgC,EAAC,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAC,gCAAgC,EAAC,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAC,qBAAqB,EAAC,MAAM,mDAAmD,CAAC;AAIxF,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,+BAA+B,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import { Queue } from "bull";
|
|
3
3
|
import { Request } from "express";
|
|
4
4
|
import Stripe from "stripe";
|
|
5
|
-
import { StripeClientConfigurationService } from "../StripeClientConfigurationService";
|
|
5
|
+
import { StripeClientConfigurationService } from "../StripeClientConfigurationService.js";
|
|
6
6
|
export declare class StripeWebhookHandler {
|
|
7
7
|
private readonly config;
|
|
8
8
|
private readonly clientInstance;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,21 +10,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
13
|
var StripeWebhookHandler_1;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const stripe_1 = __importDefault(require("stripe"));
|
|
23
|
-
const StripeClientConfigurationService_1 = require("../StripeClientConfigurationService");
|
|
14
|
+
import { InjectQueue } from "@nestjs/bull";
|
|
15
|
+
import { BadRequestException, Inject, Injectable, Logger, } from "@nestjs/common";
|
|
16
|
+
import Stripe from "stripe";
|
|
17
|
+
import { StripeClientConfigurationService } from "../StripeClientConfigurationService.js";
|
|
24
18
|
let StripeWebhookHandler = StripeWebhookHandler_1 = class StripeWebhookHandler {
|
|
25
19
|
config;
|
|
26
20
|
clientInstance;
|
|
27
21
|
queue;
|
|
28
|
-
logger = new
|
|
22
|
+
logger = new Logger(StripeWebhookHandler_1.name);
|
|
29
23
|
constructor(config, clientInstance, queue) {
|
|
30
24
|
this.config = config;
|
|
31
25
|
this.clientInstance = clientInstance;
|
|
@@ -46,16 +40,16 @@ let StripeWebhookHandler = StripeWebhookHandler_1 = class StripeWebhookHandler {
|
|
|
46
40
|
}
|
|
47
41
|
catch (error) {
|
|
48
42
|
this.logger.error(`Webhook signature verification failed.`, error);
|
|
49
|
-
throw new
|
|
43
|
+
throw new BadRequestException("Webhook signature verification failed or other payment error.");
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
46
|
};
|
|
53
47
|
StripeWebhookHandler = StripeWebhookHandler_1 = __decorate([
|
|
54
|
-
|
|
55
|
-
__param(1,
|
|
56
|
-
__param(2,
|
|
57
|
-
__metadata("design:paramtypes", [
|
|
58
|
-
|
|
48
|
+
Injectable(),
|
|
49
|
+
__param(1, Inject("StripeClient")),
|
|
50
|
+
__param(2, InjectQueue("stripe-events")),
|
|
51
|
+
__metadata("design:paramtypes", [StripeClientConfigurationService,
|
|
52
|
+
Stripe, Object])
|
|
59
53
|
], StripeWebhookHandler);
|
|
60
|
-
|
|
54
|
+
export { StripeWebhookHandler };
|
|
61
55
|
//# 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,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EACH,mBAAmB,EACnB,MAAM,EACN,UAAU,EACV,MAAM,GAET,MAAM,gBAAgB,CAAC;AAGxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,gCAAgC,EAAC,MA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|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const stripe_webhook_controller_1 = require("./controllers/stripe-webhook-controller");
|
|
26
|
-
const stripe_customer_portal_controller_1 = require("./controllers/stripe-customer-portal-controller");
|
|
27
|
-
const organisation_subscriptions_module_1 = require("../organisation-subscriptions/organisation-subscriptions.module");
|
|
28
|
-
const payment_session_module_1 = require("../payment-sessions/payment-session.module");
|
|
29
|
-
const stripe_events_controller_1 = require("./controllers/stripe-events-controller");
|
|
7
|
+
import { Module } from "@nestjs/common";
|
|
8
|
+
import "reflect-metadata";
|
|
9
|
+
import { StripeClientConfigurationService } from "./StripeClientConfigurationService.js";
|
|
10
|
+
import { StripeCheckoutService } from "./services/stripe-checkout.service.js";
|
|
11
|
+
import configVariables from "./StripeConfigurationVariables.js";
|
|
12
|
+
import { ConfigModule } from "@nestjs/config";
|
|
13
|
+
import { CoreModule } from "../root-app/core-app.module.js";
|
|
14
|
+
import { StripeClientProvider } from "./StripeClientProvider.js";
|
|
15
|
+
import { BullModule } from "@nestjs/bull";
|
|
16
|
+
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
17
|
+
import { StripeCheckoutEvent } from "./entities/stripe-checkout-event.entity.js";
|
|
18
|
+
import { StripeWebhookHandler } from "./services/stripe-webhook-handler.service.js";
|
|
19
|
+
import { StripeWebhookController } from "./controllers/stripe-webhook-controller.js";
|
|
20
|
+
import { StripeCustomerPortalController } from "./controllers/stripe-customer-portal-controller.js";
|
|
21
|
+
import { OrganisationSubscriptionsModule } from "../organisation-subscriptions/organisation-subscriptions.module.js";
|
|
22
|
+
import { PaymentSessionModule } from "../payment-sessions/payment-session.module.js";
|
|
23
|
+
import { StripeEventsController } from "./controllers/stripe-events-controller.js";
|
|
30
24
|
let StripeAccountModule = class StripeAccountModule {
|
|
31
25
|
};
|
|
32
26
|
StripeAccountModule = __decorate([
|
|
33
|
-
|
|
27
|
+
Module({
|
|
34
28
|
imports: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
ConfigModule.forFeature(configVariables),
|
|
30
|
+
TypeOrmModule.forFeature([StripeCheckoutEvent]),
|
|
31
|
+
CoreModule,
|
|
32
|
+
OrganisationSubscriptionsModule,
|
|
33
|
+
BullModule.registerQueueAsync({
|
|
40
34
|
name: "stripe-events",
|
|
41
35
|
}),
|
|
42
|
-
|
|
36
|
+
PaymentSessionModule,
|
|
43
37
|
],
|
|
44
38
|
providers: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
StripeClientProvider,
|
|
40
|
+
StripeClientConfigurationService,
|
|
41
|
+
StripeCheckoutService,
|
|
42
|
+
StripeWebhookHandler,
|
|
49
43
|
],
|
|
50
44
|
exports: [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
TypeOrmModule,
|
|
46
|
+
StripeCheckoutService,
|
|
47
|
+
BullModule,
|
|
48
|
+
StripeWebhookHandler,
|
|
49
|
+
StripeClientProvider,
|
|
56
50
|
],
|
|
57
51
|
controllers: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
StripeWebhookController,
|
|
53
|
+
StripeCustomerPortalController,
|
|
54
|
+
StripeEventsController,
|
|
61
55
|
],
|
|
62
56
|
})
|
|
63
57
|
], StripeAccountModule);
|
|
64
|
-
|
|
58
|
+
export { StripeAccountModule };
|
|
65
59
|
//# sourceMappingURL=stripe-account.module.js.map
|