@punks/backend-entity-manager 0.0.53 → 0.0.55

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.
@@ -3,3 +3,4 @@ export { AppHashingService } from "./hashing";
3
3
  export { EntityManagerService } from "./manager";
4
4
  export { EmailService } from "./email";
5
5
  export { EventsService } from "./events";
6
+ export { TrackingService } from "./tracking";
@@ -3,4 +3,5 @@ import { EventsService } from "./events";
3
3
  import { AppHashingService } from "./hashing";
4
4
  import { EntityManagerService } from "./manager";
5
5
  import { AppSessionService } from "./session";
6
- export declare const Services: (typeof AppSessionService | typeof AppHashingService | typeof EntityManagerService | typeof EmailService | typeof EventsService)[];
6
+ import { TrackingService } from "./tracking";
7
+ export declare const Services: (typeof AppSessionService | typeof AppHashingService | typeof EntityManagerService | typeof EmailService | typeof EventsService | typeof TrackingService)[];
@@ -0,0 +1,8 @@
1
+ import { EntityManagerRegistry } from "../../ioc";
2
+ import { IEventLog } from "../../../../abstractions";
3
+ export declare class TrackingService {
4
+ private readonly registry;
5
+ constructor(registry: EntityManagerRegistry);
6
+ trackEvent<T>(event: IEventLog<T>): Promise<void>;
7
+ private get tracker();
8
+ }
package/dist/esm/index.js CHANGED
@@ -82,7 +82,7 @@ var SortDirection;
82
82
  const PLATFORM_EVENT_NAMESPACE = "platform";
83
83
  const PlatformEvents = {
84
84
  Messaging: {
85
- EmailSent: `${PLATFORM_EVENT_NAMESPACE}.messaging:email.sent`,
85
+ EmailSent: `${PLATFORM_EVENT_NAMESPACE}:messaging.emailSent`,
86
86
  },
87
87
  };
88
88
 
@@ -225,11 +225,11 @@ class OperationTokenMismatchError extends AuthenticationError {
225
225
 
226
226
  const AUTHENTICATION_EVENTS_NAMESPACE = "authentication";
227
227
  const AuthenticationEvents = {
228
- UserLogin: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.login`,
229
- UserRegistrationStarted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.registrationStarted`,
230
- UserRegistrationCompleted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.registrationCompleted`,
231
- UserPasswordResetStarted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.passwordResetStarted`,
232
- UserPasswordResetCompleted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.passwordResetCompleted`,
228
+ UserLogin: `${AUTHENTICATION_EVENTS_NAMESPACE}:user.login`,
229
+ UserRegistrationStarted: `${AUTHENTICATION_EVENTS_NAMESPACE}:user.registrationStarted`,
230
+ UserRegistrationCompleted: `${AUTHENTICATION_EVENTS_NAMESPACE}:user.registrationCompleted`,
231
+ UserPasswordResetStarted: `${AUTHENTICATION_EVENTS_NAMESPACE}:user.passwordResetStarted`,
232
+ UserPasswordResetCompleted: `${AUTHENTICATION_EVENTS_NAMESPACE}:user.passwordResetCompleted`,
233
233
  };
234
234
 
235
235
  /******************************************************************************
@@ -18956,6 +18956,25 @@ EventsService = __decorate([
18956
18956
  __metadata("design:paramtypes", [EntityManagerRegistry])
18957
18957
  ], EventsService);
18958
18958
 
18959
+ let TrackingService = class TrackingService {
18960
+ constructor(registry) {
18961
+ this.registry = registry;
18962
+ }
18963
+ async trackEvent(event) {
18964
+ await this.tracker.track(event);
18965
+ }
18966
+ get tracker() {
18967
+ return this.registry
18968
+ .getContainer()
18969
+ .getEntitiesServicesLocator()
18970
+ .resolveEventsTracker();
18971
+ }
18972
+ };
18973
+ TrackingService = __decorate([
18974
+ Injectable(),
18975
+ __metadata("design:paramtypes", [EntityManagerRegistry])
18976
+ ], TrackingService);
18977
+
18959
18978
  let AuthenticationServicesResolver = class AuthenticationServicesResolver {
18960
18979
  registerUsersService(usersService) {
18961
18980
  this.usersService = usersService;
@@ -19510,6 +19529,7 @@ const Services = [
19510
19529
  EntityManagerService,
19511
19530
  EmailService,
19512
19531
  EventsService,
19532
+ TrackingService,
19513
19533
  ];
19514
19534
 
19515
19535
  const IoC = [EntityManagerRegistry];
@@ -25254,5 +25274,5 @@ AppSessionMiddleware = __decorate([
25254
25274
  Injectable()
25255
25275
  ], AppSessionMiddleware);
25256
25276
 
25257
- export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSessionMiddleware, AppSessionService, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsEmailModule, AwsSesEmailTemplate, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EventsService, InvalidCredentialsError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestTypeOrmQueryBuilder, NestTypeOrmRepository, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PlatformEvents, QueryBuilderBase, ReplicationMode, SendgridEmailModule, SendgridEmailTemplate, SortDirection, UserRegistrationError, WpAppInitializer, WpAwsSesEmailTemplate, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEventsTracker, WpSendgridEmailTemplate, WpUserService, getLocalizedText, newUuid, renderHandlebarsTemplate };
25277
+ export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSessionMiddleware, AppSessionService, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsEmailModule, AwsSesEmailTemplate, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EventsService, InvalidCredentialsError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestTypeOrmQueryBuilder, NestTypeOrmRepository, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PlatformEvents, QueryBuilderBase, ReplicationMode, SendgridEmailModule, SendgridEmailTemplate, SortDirection, TrackingService, UserRegistrationError, WpAppInitializer, WpAwsSesEmailTemplate, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEventsTracker, WpSendgridEmailTemplate, WpUserService, getLocalizedText, newUuid, renderHandlebarsTemplate };
25258
25278
  //# sourceMappingURL=index.js.map