import deepmerge from 'deepmerge';
import common from '../definitions/observable-common.json';
import rawDefinition from '../definitions/x509-certificate.json';

import { Base } from './Base';

class Certificate extends Base {
  constructor() {
    const definition_extension = {
      img: 'observable.png',
      prefix: 'x509-certificate--',
      active: false,
      relationships: [],
    };

    const def = deepmerge(definition_extension, rawDefinition);

    super(common, def);

    this.properties.x509_v3_extensions.type = 'string';
  }
}

const singleton = new Certificate();

export default singleton;
