cloud-ide-lms-model
Version:
Package for Model management of Cloud IDEsys LMS
96 lines (95 loc) • 3.17 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MRestoreRunPayload = exports.MBackupRunPayload = exports.MDeploymentJobInsertPayload = exports.MDeploymentArtifactInsertPayload = void 0;
class MDeploymentArtifactInsertPayload {
constructor(init) {
this.appCode = "";
this.artifactType = "ui";
this.artifactVersion = "";
this.sourceMode = "LOCAL_BUILD";
this.sourceRef = "";
this.checksum = "";
this.createdBy = "";
this.backupStatus = "PENDING";
Object.assign(this, init);
}
Validate() {
const errors = {};
if (!this.appCode)
errors.appCode = "App code is required.";
if (!this.artifactVersion)
errors.artifactVersion = "Artifact version is required.";
if (!this.sourceRef)
errors.sourceRef = "Source reference is required.";
return errors;
}
}
exports.MDeploymentArtifactInsertPayload = MDeploymentArtifactInsertPayload;
class MDeploymentJobInsertPayload {
constructor(init) {
this.appCode = "";
this.artifactVersion = "";
this.environment = "dev";
this.action = "deploy";
this.sourceMode = "LOCAL_BUILD";
this.sourceRef = "";
this.reason = "";
Object.assign(this, init);
}
Validate() {
const errors = {};
if (!this.appCode)
errors.appCode = "App code is required.";
if (!this.artifactVersion)
errors.artifactVersion = "Artifact version is required.";
if (!this.sourceRef)
errors.sourceRef = "Source reference is required.";
return errors;
}
}
exports.MDeploymentJobInsertPayload = MDeploymentJobInsertPayload;
class MBackupRunPayload {
constructor(init) {
this.environment = "dev";
this.instance = "";
this.database = "";
this.backupType = "full";
this.triggeredBy = "ui-user";
this.mongoUri = "";
Object.assign(this, init);
}
Validate() {
const errors = {};
if (!this.instance)
errors.instance = "Instance is required.";
if (!this.database)
errors.database = "Database is required.";
if (!this.mongoUri)
errors.mongoUri = "Mongo URI is required.";
return errors;
}
}
exports.MBackupRunPayload = MBackupRunPayload;
class MRestoreRunPayload {
constructor(init) {
this.environment = "dev";
this.instance = "";
this.database = "";
this.backupJobId = "";
this.restoreTargetDatabase = "";
this.triggeredBy = "ui-user";
this.mongoUri = "";
Object.assign(this, init);
}
Validate() {
const errors = {};
if (!this.backupJobId)
errors.backupJobId = "Backup job ID is required.";
if (!this.restoreTargetDatabase)
errors.restoreTargetDatabase = "Restore target database is required.";
if (!this.mongoUri)
errors.mongoUri = "Mongo URI is required.";
return errors;
}
}
exports.MRestoreRunPayload = MRestoreRunPayload;