32 lines
3.2 KiB
JavaScript
32 lines
3.2 KiB
JavaScript
|
"use strict";
|
||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||
|
};
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.ActionCommandBase = exports.CommandBase = void 0;
|
||
|
const nanoid_1 = require("nanoid");
|
||
|
const assignable_1 = __importDefault(require("../../utils/assignable"));
|
||
|
const COMMON_NOT_REPORTED_PROPERTIES = ['studio'];
|
||
|
class CommandBase extends assignable_1.default {
|
||
|
constructor(obj, testRun, type, validateProperties = true) {
|
||
|
super();
|
||
|
this.type = type;
|
||
|
this.actionId = (obj === null || obj === void 0 ? void 0 : obj.actionId) || (0, nanoid_1.nanoid)(7);
|
||
|
this._assignFrom(obj, validateProperties, { testRun });
|
||
|
}
|
||
|
getAssignableProperties() {
|
||
|
return [];
|
||
|
}
|
||
|
getNonReportedProperties() {
|
||
|
return COMMON_NOT_REPORTED_PROPERTIES;
|
||
|
}
|
||
|
}
|
||
|
exports.CommandBase = CommandBase;
|
||
|
class ActionCommandBase extends CommandBase {
|
||
|
get methodName() {
|
||
|
return this.constructor.methodName;
|
||
|
}
|
||
|
}
|
||
|
exports.ActionCommandBase = ActionCommandBase;
|
||
|
ActionCommandBase.methodName = 'actionCommandBase';
|
||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90ZXN0LXJ1bi9jb21tYW5kcy9iYXNlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLG1DQUFnQztBQUNoQyx3RUFBZ0Q7QUFFaEQsTUFBTSw4QkFBOEIsR0FBRyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBRWxELE1BQWEsV0FBWSxTQUFRLG9CQUFVO0lBQ3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