@schorts/shared-kernel 2.5.0 → 2.5.1
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/CHANGELOG +6 -0
- package/dist/cjs/domain-events/domain-event.js +10 -0
- package/dist/cjs/domain-events/domain-event.js.map +1 -1
- package/dist/esm/domain-events/domain-event.js +10 -0
- package/dist/esm/domain-events/domain-event.js.map +1 -1
- package/dist/types/domain-events/domain-event.d.ts +1 -1
- package/dist/types/domain-events/domain-event.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/domain-events/domain-event.ts +11 -1
package/CHANGELOG
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.5.1] - 2025-10-13
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `toPrimitives` method from `DomainEvent` now is defined in the abstract class. In future versions the `DomainEventRegistry` will be updated to handle the transformation of values like date/string and preserve it between conversions.
|
|
13
|
+
|
|
8
14
|
## [2.5.0] - 2025-10-12
|
|
9
15
|
|
|
10
16
|
### Added
|
|
@@ -16,6 +16,16 @@ class DomainEvent {
|
|
|
16
16
|
this.payload = payload;
|
|
17
17
|
this.meta = meta;
|
|
18
18
|
}
|
|
19
|
+
toPrimitives() {
|
|
20
|
+
return {
|
|
21
|
+
id: this.id,
|
|
22
|
+
occurred_at: this.occurredAt.toString(),
|
|
23
|
+
type: this.type,
|
|
24
|
+
version: this.version,
|
|
25
|
+
payload: this.payload,
|
|
26
|
+
meta: this.meta,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
19
29
|
ack;
|
|
20
30
|
requeue;
|
|
21
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/domain-events/domain-event.ts"],"names":[],"mappings":";;;AAGA,MAAsB,WAAW;IAEpB;IACA;IACA;IACA;IACA;IACF;IANT,YACW,EAAU,EACV,UAAgB,EAChB,IAAY,EACZ,OAAe,EACf,OAAsB,EACxB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE;QALnB,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAAM;QAChB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAe;QACxB,SAAI,GAAJ,IAAI,CAAiB;IAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/domain-events/domain-event.ts"],"names":[],"mappings":";;;AAGA,MAAsB,WAAW;IAEpB;IACA;IACA;IACA;IACA;IACF;IANT,YACW,EAAU,EACV,UAAgB,EAChB,IAAY,EACZ,OAAe,EACf,OAAsB,EACxB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE;QALnB,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAAM;QAChB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAe;QACxB,SAAI,GAAJ,IAAI,CAAiB;IAC3B,CAAC;IAIJ,YAAY;QACV,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;IAED,GAAG,CAAc;IACjB,OAAO,CAAc;CACtB;AAzBD,kCAyBC"}
|
|
@@ -16,6 +16,16 @@ class DomainEvent {
|
|
|
16
16
|
this.payload = payload;
|
|
17
17
|
this.meta = meta;
|
|
18
18
|
}
|
|
19
|
+
toPrimitives() {
|
|
20
|
+
return {
|
|
21
|
+
id: this.id,
|
|
22
|
+
occurred_at: this.occurredAt.toString(),
|
|
23
|
+
type: this.type,
|
|
24
|
+
version: this.version,
|
|
25
|
+
payload: this.payload,
|
|
26
|
+
meta: this.meta,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
19
29
|
ack;
|
|
20
30
|
requeue;
|
|
21
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/domain-events/domain-event.ts"],"names":[],"mappings":";;;AAGA,MAAsB,WAAW;IAEpB;IACA;IACA;IACA;IACA;IACF;IANT,YACW,EAAU,EACV,UAAgB,EAChB,IAAY,EACZ,OAAe,EACf,OAAsB,EACxB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE;QALnB,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAAM;QAChB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAe;QACxB,SAAI,GAAJ,IAAI,CAAiB;IAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/domain-events/domain-event.ts"],"names":[],"mappings":";;;AAGA,MAAsB,WAAW;IAEpB;IACA;IACA;IACA;IACA;IACF;IANT,YACW,EAAU,EACV,UAAgB,EAChB,IAAY,EACZ,OAAe,EACf,OAAsB,EACxB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE;QALnB,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAAM;QAChB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAe;QACxB,SAAI,GAAJ,IAAI,CAAiB;IAC3B,CAAC;IAIJ,YAAY;QACV,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;IAED,GAAG,CAAc;IACjB,OAAO,CAAc;CACtB;AAzBD,kCAyBC"}
|
|
@@ -13,7 +13,7 @@ export declare abstract class DomainEvent<PayloadSchema = {}> implements Message
|
|
|
13
13
|
retries: number;
|
|
14
14
|
});
|
|
15
15
|
abstract getEventName(): string;
|
|
16
|
-
|
|
16
|
+
toPrimitives(): DomainEventPrimitives<PayloadSchema>;
|
|
17
17
|
ack?: () => void;
|
|
18
18
|
requeue?: () => void;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event.d.ts","sourceRoot":"","sources":["../../../src/domain-events/domain-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,8BAAsB,WAAW,CAAC,aAAa,GAAG,EAAE,CAAE,YAAW,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAE1G,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,QAAQ,CAAC,UAAU,EAAE,IAAI;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,QAAQ,CAAC,OAAO,EAAE,aAAa;IACxB,IAAI;;;gBALF,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,IAAI,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACxB,IAAI;;KAAiB;IAG9B,QAAQ,CAAC,YAAY,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"domain-event.d.ts","sourceRoot":"","sources":["../../../src/domain-events/domain-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,8BAAsB,WAAW,CAAC,aAAa,GAAG,EAAE,CAAE,YAAW,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAE1G,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,QAAQ,CAAC,UAAU,EAAE,IAAI;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,QAAQ,CAAC,OAAO,EAAE,aAAa;IACxB,IAAI;;;gBALF,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,IAAI,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACxB,IAAI;;KAAiB;IAG9B,QAAQ,CAAC,YAAY,IAAI,MAAM;IAE/B,YAAY,IAAI,qBAAqB,CAAC,aAAa,CAAC;IAWpD,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schorts/shared-kernel",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "A modular, type-safe foundation for building expressive, maintainable applications. This package provides core abstractions for domain modeling, HTTP integration, authentication, state management, and more — designed to be framework-agnostic and highly extensible.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -12,7 +12,17 @@ export abstract class DomainEvent<PayloadSchema = {}> implements Message<DomainE
|
|
|
12
12
|
) {}
|
|
13
13
|
|
|
14
14
|
abstract getEventName(): string;
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
toPrimitives(): DomainEventPrimitives<PayloadSchema> {
|
|
17
|
+
return {
|
|
18
|
+
id: this.id,
|
|
19
|
+
occurred_at: this.occurredAt.toString(),
|
|
20
|
+
type: this.type,
|
|
21
|
+
version: this.version,
|
|
22
|
+
payload: this.payload,
|
|
23
|
+
meta: this.meta,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
16
26
|
|
|
17
27
|
ack?: () => void;
|
|
18
28
|
requeue?: () => void;
|