contentful-migration
Version:
Migration tooling for contentful
29 lines • 998 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FieldAnnotateAction = void 0;
const action_1 = require("./action");
class FieldAnnotateAction extends action_1.EntityAction {
constructor(contentTypeId, fieldId, annotations, fieldAnnotationPayload) {
super();
this.contentTypeId = contentTypeId;
this.fieldId = fieldId;
this.annotations = annotations;
this.fieldAnnotationPayload = fieldAnnotationPayload;
}
getEntityId() {
return this.contentTypeId;
}
getEntityType() {
return action_1.EntityType.ContentType;
}
async applyTo(ct) {
if (!this.annotations || !this.annotations.length) {
ct.clearFieldAnnotations(this.fieldId);
}
else {
ct.setFieldAnnotations(this.fieldId, this.annotations, this.fieldAnnotationPayload);
}
}
}
exports.FieldAnnotateAction = FieldAnnotateAction;
//# sourceMappingURL=field-annotate.js.map