@my-devkit/core 1.0.103 → 1.0.104
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/event.d.ts +1 -0
- package/dist/event.js +7 -0
- package/dist/event.js.map +1 -1
- package/package.json +1 -1
- package/src/event.ts +3 -0
package/dist/event.d.ts
CHANGED
package/dist/event.js
CHANGED
|
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Event = void 0;
|
|
13
|
+
const date_helper_1 = require("./date-helper");
|
|
13
14
|
const guid_1 = require("./guid");
|
|
14
15
|
const serialize_1 = require("./serialize");
|
|
15
16
|
class Event {
|
|
@@ -21,8 +22,10 @@ class Event {
|
|
|
21
22
|
this._aggregateId = null;
|
|
22
23
|
this._publishedBy = null;
|
|
23
24
|
this._publishedAt = null;
|
|
25
|
+
this._expiresAt = null;
|
|
24
26
|
this.id = (0, guid_1.guid)();
|
|
25
27
|
this._type = this.constructor.name;
|
|
28
|
+
this._expiresAt = date_helper_1.DateHelper.addDays(new Date(), 60);
|
|
26
29
|
}
|
|
27
30
|
get _path() {
|
|
28
31
|
return `/events/${this.id}`;
|
|
@@ -65,4 +68,8 @@ __decorate([
|
|
|
65
68
|
(0, serialize_1.autoserializeAs)(String),
|
|
66
69
|
__metadata("design:type", String)
|
|
67
70
|
], Event.prototype, "_publishedAt", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, serialize_1.autoserializeAs)(Date),
|
|
73
|
+
__metadata("design:type", Date)
|
|
74
|
+
], Event.prototype, "_expiresAt", void 0);
|
|
68
75
|
//# sourceMappingURL=event.js.map
|
package/dist/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,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A,2BAAe,EAAC,MAAM,CAAC;;iCAA2B;AACnB;IAA/B,IAAA,2BAAe,EAAC,MAAM,CAAC;;oCAA8B;AACtB;IAA/B,IAAA,2BAAe,EAAC,MAAM,CAAC;;6CAAuC;AAC/B;IAA/B,IAAA,2BAAe,EAAC,MAAM,CAAC;;6CAAuC;AAC/B;IAA/B,IAAA,2BAAe,EAAC,MAAM,CAAC;;2CAAqC;AAC7B;IAA/B,IAAA,2BAAe,EAAC,MAAM,CAAC;;2CAAqC;AAC5B;IAAhC,IAAA,2BAAe,EAAC,MAAM,CAAC;;2CAAsC;AAC/B;IAA9B,IAAA,2BAAe,EAAC,IAAI,CAAC;8BAAsB,IAAI;yCAAQ"}
|
package/package.json
CHANGED
package/src/event.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DateHelper } from './date-helper';
|
|
1
2
|
import { Document } from './document';
|
|
2
3
|
import { guid } from './guid';
|
|
3
4
|
import { autoserializeAs } from './serialize';
|
|
@@ -11,10 +12,12 @@ export abstract class Event implements Document {
|
|
|
11
12
|
@autoserializeAs(String) public _aggregateId?: string = null;
|
|
12
13
|
@autoserializeAs(String) public _publishedBy?: string = null;
|
|
13
14
|
@autoserializeAs(String) private _publishedAt?: string = null;
|
|
15
|
+
@autoserializeAs(Date) private _expiresAt?: Date = null;
|
|
14
16
|
|
|
15
17
|
constructor() {
|
|
16
18
|
this.id = guid();
|
|
17
19
|
this._type = this.constructor.name;
|
|
20
|
+
this._expiresAt = DateHelper.addDays(new Date(), 60);
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
public get _path(): string {
|