@hg-ts/events 0.2.23 → 0.2.24
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/base.event.d.ts +9 -2
- package/dist/base.event.d.ts.map +1 -1
- package/dist/base.event.js +2 -2
- package/dist/base.event.js.map +1 -1
- package/package.json +5 -5
package/dist/base.event.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
export type BaseEventDto = {
|
|
2
|
+
name: string;
|
|
3
|
+
body: unknown;
|
|
4
|
+
occurredOn: Date;
|
|
5
|
+
traceId: Nullable<string>;
|
|
6
|
+
};
|
|
1
7
|
export type EventParams<Body> = {
|
|
2
8
|
body: Body;
|
|
3
9
|
occurredOn?: Date;
|
|
4
|
-
|
|
10
|
+
name?: string;
|
|
11
|
+
traceId?: Nullable<string>;
|
|
5
12
|
};
|
|
6
13
|
export declare abstract class BaseEvent<Body = unknown> {
|
|
7
14
|
readonly occurredOn: Date;
|
|
8
15
|
readonly name: string;
|
|
9
16
|
readonly body: Body;
|
|
10
17
|
readonly traceId: Nullable<string>;
|
|
11
|
-
constructor({ body, occurredOn, traceId }: EventParams<Body>);
|
|
18
|
+
constructor({ name, body, occurredOn, traceId }: EventParams<Body>);
|
|
12
19
|
}
|
|
13
20
|
//# sourceMappingURL=base.event.d.ts.map
|
package/dist/base.event.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.event.d.ts","sourceRoot":"","sources":["../src/base.event.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,IAAI,IAAI;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"base.event.d.ts","sourceRoot":"","sources":["../src/base.event.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,IAAI,CAAC;IACjB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC1B,CAAA;AAED,MAAM,MAAM,WAAW,CAAC,IAAI,IAAI;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC3B,CAAA;AAED,8BAAsB,SAAS,CAAC,IAAI,GAAG,OAAO;IAC7C,SAAgB,UAAU,EAAE,IAAI,CAAC;IACjC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,IAAI,EAAE,IAAI,CAAC;IAE3B,SAAgB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAEvB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAuB,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC;CAOtF"}
|
package/dist/base.event.js
CHANGED
|
@@ -6,10 +6,10 @@ class BaseEvent {
|
|
|
6
6
|
name;
|
|
7
7
|
body;
|
|
8
8
|
traceId;
|
|
9
|
-
constructor({ body, occurredOn = new Date(), traceId }) {
|
|
9
|
+
constructor({ name, body, occurredOn = new Date(), traceId }) {
|
|
10
10
|
this.body = body;
|
|
11
11
|
this.occurredOn = occurredOn;
|
|
12
|
-
this.name = this.constructor.name;
|
|
12
|
+
this.name = name ?? this.constructor.name;
|
|
13
13
|
this.traceId = traceId ?? null;
|
|
14
14
|
}
|
|
15
15
|
}
|
package/dist/base.event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.event.js","sourceRoot":"","sources":["../src/base.event.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base.event.js","sourceRoot":"","sources":["../src/base.event.ts"],"names":[],"mappings":";;;AAcA,MAAsB,SAAS;IACd,UAAU,CAAO;IACjB,IAAI,CAAS;IACb,IAAI,CAAO;IAEX,OAAO,CAAmB;IAE1C,YAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,IAAI,EAAE,EAAE,OAAO,EAAqB;QACrF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAE1C,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC;IAChC,CAAC;CACD;AAdD,8BAcC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hg-ts/events",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js"
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"test:dev": "yarn build:dev --onSuccess \"yarn test\""
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@hg-ts-config/typescript": "0.2.
|
|
21
|
-
"@hg-ts/linter": "0.2.
|
|
22
|
-
"@hg-ts/tests": "0.2.
|
|
23
|
-
"@hg-ts/types": "0.2.
|
|
20
|
+
"@hg-ts-config/typescript": "0.2.24",
|
|
21
|
+
"@hg-ts/linter": "0.2.24",
|
|
22
|
+
"@hg-ts/tests": "0.2.24",
|
|
23
|
+
"@hg-ts/types": "0.2.24",
|
|
24
24
|
"@types/node": "22.10.6",
|
|
25
25
|
"eslint": "9.18.0",
|
|
26
26
|
"reflect-metadata": "0.2.2",
|