@punks/backend-entity-manager 0.0.55 → 0.0.58

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.
@@ -23,6 +23,7 @@ export declare class UserLoginResponse {
23
23
  }
24
24
  export declare class UserRegisterRequest {
25
25
  email: string;
26
+ userName: string;
26
27
  password: string;
27
28
  data: UserRegistrationData;
28
29
  userContext: UserContext;
@@ -6,6 +6,7 @@ export type UserRegisterCallbackTemplate = {
6
6
  };
7
7
  export interface UserRegistrationInput<TUserRegistrationInfo, TUserContext extends IUserContext> {
8
8
  email: string;
9
+ userName: string;
9
10
  password: string;
10
11
  registrationInfo: TUserRegistrationInfo;
11
12
  callback: UserRegisterCallbackTemplate;
@@ -1,7 +1,14 @@
1
1
  import { EntityManagerRegistry } from "../../ioc";
2
+ export type IEventData<TEventPayload> = {
3
+ payload?: TEventPayload;
4
+ userId?: string;
5
+ userName?: string;
6
+ timestamp?: Date;
7
+ };
2
8
  export declare class EventsService {
3
9
  private readonly registry;
4
10
  constructor(registry: EntityManagerRegistry);
5
- emitEvent<TEventPayload>(eventName: string, eventPayload: TEventPayload): Promise<void>;
11
+ emitEvent<TEventPayload>(eventName: string, eventData: IEventData<TEventPayload>): Promise<void>;
12
+ private buildPayload;
6
13
  private get eventEmitter();
7
14
  }
package/dist/index.d.ts CHANGED
@@ -918,6 +918,7 @@ type UserRegisterCallbackTemplate = {
918
918
  };
919
919
  interface UserRegistrationInput<TUserRegistrationInfo, TUserContext extends IUserContext> {
920
920
  email: string;
921
+ userName: string;
921
922
  password: string;
922
923
  registrationInfo: TUserRegistrationInfo;
923
924
  callback: UserRegisterCallbackTemplate;
@@ -986,10 +987,17 @@ declare class EmailService {
986
987
  private get provider();
987
988
  }
988
989
 
990
+ type IEventData<TEventPayload> = {
991
+ payload?: TEventPayload;
992
+ userId?: string;
993
+ userName?: string;
994
+ timestamp?: Date;
995
+ };
989
996
  declare class EventsService {
990
997
  private readonly registry;
991
998
  constructor(registry: EntityManagerRegistry);
992
- emitEvent<TEventPayload>(eventName: string, eventPayload: TEventPayload): Promise<void>;
999
+ emitEvent<TEventPayload>(eventName: string, eventData: IEventData<TEventPayload>): Promise<void>;
1000
+ private buildPayload;
993
1001
  private get eventEmitter();
994
1002
  }
995
1003
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/backend-entity-manager",
3
- "version": "0.0.55",
3
+ "version": "0.0.58",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",