@mcma/core
Version:
Node module with type definitions and helper utils for the EBU MCMA framework
39 lines (38 loc) • 1.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Job = void 0;
const job_base_1 = require("../job-base");
const job_parameter_bag_1 = require("../job-parameter-bag");
const mcma_tracker_1 = require("../mcma-tracker");
const notification_endpoint_1 = require("../notification-endpoint");
const utils_1 = require("../../utils");
class Job extends job_base_1.JobBase {
parentId;
jobProfileId;
jobInput;
timeout;
deadline;
tracker;
notificationEndpoint;
constructor(type, properties) {
super(type, properties);
this.parentId = properties.parentId;
this.jobProfileId = properties.jobProfileId;
this.jobInput = new job_parameter_bag_1.JobParameterBag(properties.jobInput);
this.timeout = properties.timeout;
this.deadline = utils_1.Utils.ensureValidDateOrUndefined(properties.deadline);
if (typeof properties.tracker === "object") {
this.tracker = new mcma_tracker_1.McmaTracker(properties.tracker);
}
if (typeof properties.notificationEndpoint === "object") {
this.notificationEndpoint = new notification_endpoint_1.NotificationEndpoint(properties.notificationEndpoint);
}
utils_1.Utils.checkProperty(this, "parentId", "string", false);
utils_1.Utils.checkProperty(this, "jobProfileId", "url", true);
utils_1.Utils.checkProperty(this, "jobInput", "object", false);
utils_1.Utils.checkProperty(this, "timeout", "number", false);
utils_1.Utils.checkProperty(this, "tracker", "object", false);
utils_1.Utils.checkProperty(this, "notificationEndpoint", "object", false);
}
}
exports.Job = Job;