lib/parsers.js
function parseRelation(entity) {
  return {
    endpoints: entity.endpoints ? entity.endpoints.map(endpoint => ({
      applicationName: endpoint['application-name'],
      relation: {
        name: endpoint.relation.name,
        role: endpoint.relation.role,
        'interface': endpoint.relation.interface,
        optional: endpoint.relation.optional,
        limit: endpoint.relation.limit,
        scope: endpoint.relation.scope
      }
    })) : undefined,
    id: entity.id,
    key: entity.key,
    modelUUID: entity['model-uuid']
  };
}
function parseRelation(entity) {
  return {
    endpoints: entity.endpoints ? entity.endpoints.map(endpoint => ({
      applicationName: endpoint['application-name'],
      relation: {
        name: endpoint.relation.name,
        role: endpoint.relation.role,
        'interface': endpoint.relation.interface,
        optional: endpoint.relation.optional,
        limit: endpoint.relation.limit,
        scope: endpoint.relation.scope
      }
    })) : undefined,
    id: entity.id,
    key: entity.key,
    modelUUID: entity['model-uuid']
  };
}
function parseRelation ( entity ) { return { endpoints : entity . endpoints ? entity . endpoints . map ( endpoint => ( { applicationName : endpoint [ 'application-name' ] , relation : { name : endpoint . relation . name , role : endpoint . relation . role , 'interface' : endpoint . relation . interface , optional : endpoint . relation . optional , limit : endpoint . relation . limit , scope : endpoint . relation . scope } } ) ) : undefined , id : entity . id , key : entity . key , modelUUID : entity [ 'model-uuid' ] } ; }
Parse a relation.
@param {Object} entity - The entity details.
@param {Object[]} entity.endpoints - The list of endpoint objects.
@param {String} entity.endpoints[].application-name - The application name.
@param {Object} entity.endpoints[].relation - The relation details.
@param {String} entity.endpoints[].relation.name - The relation name.
@param {String} entity.endpoints[].relation.role - The relation role.
@param {String} entity.endpoints[].relation.interface - The relation interface.
@param {Boolean} entity.endpoints[].relation.option - Whether the relation is optional.
@param {Integer} entity.endpoints[].relation.limit - The relation limit.
@param {String} entity.endpoints[].relation.scope - The relation scope.
@param {String} entity.id - The entity id.
@param {String} entity.string - The entity string.
@param {String} entity.model-uuid - The model uuid this entity belongs to.
@returns {Object} return - The parsed entity.
@returns {Object[]} return.endpoints - The list of endpoint objects.
@returns {String} return.endpoints[].applicationName - The application name.
@returns {Object} return.endpoints[].relation - The relation details.
@returns {String} return.endpoints[].relation.name - The relation name.
@returns {String} return.endpoints[].relation.role - The relation role.
@returns {String} return.endpoints[].relation.interface - The relation interface.
@returns {Boolean} return.endpoints[].relation.option - Whether the relation
is optional.
@returns {Integer} return.endpoints[].relation.limit - The relation limit.
@returns {String} return.endpoints[].relation.scope - The relation scope.
@returns {String} return.id - The entity id.
@returns {String} return.string - The entity string.
@returns {String} return.modelUUID - The model uuid this entity belongs to.
Parse a relation .