@punks/backend-entity-manager 0.0.52 → 0.0.54

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/cjs/index.js CHANGED
@@ -87,9 +87,10 @@ exports.SortDirection = void 0;
87
87
  SortDirection["Desc"] = "desc";
88
88
  })(exports.SortDirection || (exports.SortDirection = {}));
89
89
 
90
+ const PLATFORM_EVENT_NAMESPACE = "platform";
90
91
  const PlatformEvents = {
91
92
  Messaging: {
92
- EmailSent: "platform:messaging:email.sent",
93
+ EmailSent: `${PLATFORM_EVENT_NAMESPACE}.messaging:email.sent`,
93
94
  },
94
95
  };
95
96
 
@@ -230,12 +231,13 @@ class OperationTokenMismatchError extends AuthenticationError {
230
231
  }
231
232
  }
232
233
 
234
+ const AUTHENTICATION_EVENTS_NAMESPACE = "authentication";
233
235
  const AuthenticationEvents = {
234
- UserLogin: "authentication:user.login",
235
- UserRegistrationStarted: "authentication:user.registrationStarted",
236
- UserRegistrationCompleted: "authentication:user.registrationCompleted",
237
- UserPasswordResetStarted: "authentication:user.passwordResetStarted",
238
- UserPasswordResetCompleted: "authentication:user.passwordResetCompleted",
236
+ UserLogin: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.login`,
237
+ UserRegistrationStarted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.registrationStarted`,
238
+ UserRegistrationCompleted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.registrationCompleted`,
239
+ UserPasswordResetStarted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.passwordResetStarted`,
240
+ UserPasswordResetCompleted: `${AUTHENTICATION_EVENTS_NAMESPACE}.user.passwordResetCompleted`,
239
241
  };
240
242
 
241
243
  /******************************************************************************
@@ -18962,6 +18964,25 @@ exports.EventsService = __decorate([
18962
18964
  __metadata("design:paramtypes", [exports.EntityManagerRegistry])
18963
18965
  ], exports.EventsService);
18964
18966
 
18967
+ exports.TrackingService = class TrackingService {
18968
+ constructor(registry) {
18969
+ this.registry = registry;
18970
+ }
18971
+ async trackEvent(event) {
18972
+ await this.tracker.track(event);
18973
+ }
18974
+ get tracker() {
18975
+ return this.registry
18976
+ .getContainer()
18977
+ .getEntitiesServicesLocator()
18978
+ .resolveEventsTracker();
18979
+ }
18980
+ };
18981
+ exports.TrackingService = __decorate([
18982
+ common.Injectable(),
18983
+ __metadata("design:paramtypes", [exports.EntityManagerRegistry])
18984
+ ], exports.TrackingService);
18985
+
18965
18986
  let AuthenticationServicesResolver = class AuthenticationServicesResolver {
18966
18987
  registerUsersService(usersService) {
18967
18988
  this.usersService = usersService;
@@ -19516,6 +19537,7 @@ const Services = [
19516
19537
  exports.EntityManagerService,
19517
19538
  exports.EmailService,
19518
19539
  exports.EventsService,
19540
+ exports.TrackingService,
19519
19541
  ];
19520
19542
 
19521
19543
  const IoC = [exports.EntityManagerRegistry];
@@ -25260,6 +25282,7 @@ exports.AppSessionMiddleware = __decorate([
25260
25282
  common.Injectable()
25261
25283
  ], exports.AppSessionMiddleware);
25262
25284
 
25285
+ exports.AUTHENTICATION_EVENTS_NAMESPACE = AUTHENTICATION_EVENTS_NAMESPACE;
25263
25286
  exports.AppExceptionsFilterBase = AppExceptionsFilterBase;
25264
25287
  exports.AppInMemorySettings = AppInMemorySettings;
25265
25288
  exports.AuthenticationEmailTemplates = AuthenticationEmailTemplates;
@@ -25281,6 +25304,7 @@ exports.NestEntityManager = NestEntityManager;
25281
25304
  exports.NestTypeOrmQueryBuilder = NestTypeOrmQueryBuilder;
25282
25305
  exports.NestTypeOrmRepository = NestTypeOrmRepository;
25283
25306
  exports.OperationTokenMismatchError = OperationTokenMismatchError;
25307
+ exports.PLATFORM_EVENT_NAMESPACE = PLATFORM_EVENT_NAMESPACE;
25284
25308
  exports.PlatformEvents = PlatformEvents;
25285
25309
  exports.QueryBuilderBase = QueryBuilderBase;
25286
25310
  exports.SendgridEmailTemplate = SendgridEmailTemplate;