UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

47 lines 1.98 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ArtifactArchived = void 0; const tiny_types_1 = require("tiny-types"); const index_js_1 = require("../io/index.js"); const index_js_2 = require("../model/index.js"); const index_js_3 = require("../screenplay/index.js"); const DomainEvent_js_1 = require("./DomainEvent.js"); /** * @group Events */ class ArtifactArchived extends DomainEvent_js_1.DomainEvent { sceneId; name; type; path; artifactTimestamp; static fromJSON(o) { return new ArtifactArchived(index_js_2.CorrelationId.fromJSON(o.sceneId), index_js_2.Name.fromJSON(o.name), index_js_2.Artifact.ofType(o.type), index_js_1.Path.fromJSON(o.path), index_js_3.Timestamp.fromJSON(o.artifactTimestamp), index_js_3.Timestamp.fromJSON(o.timestamp)); } constructor(sceneId, name, type, path, artifactTimestamp, timestamp) { super(timestamp); this.sceneId = sceneId; this.name = name; this.type = type; this.path = path; this.artifactTimestamp = artifactTimestamp; (0, tiny_types_1.ensure)('sceneId', sceneId, (0, tiny_types_1.isDefined)()); (0, tiny_types_1.ensure)('name', name, (0, tiny_types_1.isDefined)()); (0, tiny_types_1.ensure)('type', type, (0, tiny_types_1.isDefined)()); (0, tiny_types_1.ensure)('path', path, (0, tiny_types_1.isDefined)()); (0, tiny_types_1.ensure)('artifactTimestamp', artifactTimestamp, (0, tiny_types_1.isDefined)()); } toJSON() { return { sceneId: this.sceneId.toJSON(), name: this.name.toJSON(), type: this.type.name, path: this.path.toJSON(), createdAt: this.artifactTimestamp.toJSON(), timestamp: this.timestamp.toJSON(), artifactTimestamp: this.artifactTimestamp.toJSON(), }; } } exports.ArtifactArchived = ArtifactArchived; //# sourceMappingURL=ArtifactArchived.js.map