contentful-migration
Version:
Migration tooling for contentful
49 lines • 1.11 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tag = exports.default = void 0;
class Tag {
constructor(tag) {
this._id = tag.sys.id;
this._version = tag.sys.version;
this._name = tag.name;
this._visibility = tag.sys.visibility || 'private';
}
get id() {
return this._id;
}
get name() {
return this._name;
}
get version() {
return this._version;
}
set version(version) {
this._version = version;
}
set name(name) {
this._name = name;
}
get visibility() {
return this._visibility || 'private';
}
set visibility(visibility) {
this._visibility = visibility;
}
toApiTag() {
const sys = {
id: this.id,
version: this.version,
visibility: this.visibility
};
return {
sys,
name: this.name
};
}
clone() {
return new Tag(this.toApiTag());
}
}
exports.default = Tag;
exports.Tag = Tag;
//# sourceMappingURL=tag.js.map