Module: @bldr/media-server/meta-types

@bldr/media-server/meta-types

Members

config innerconstant

The configuration object from /etc/baldr.json

typeProps innerconstant

{
  person: {
    id: { validate: [Function: validate], derive: [Function: derive] },
    title: { validate: [Function: validate], derive: [Function: derive] },
    metadataType: { validate: [Function: validate] },
    wikidata: { validate: [Function: validate] },
    wikipedia: { validate: [Function: validate] },
    firstname: { required: true },
    lastname: { required: true },
    name: { derive: [Function: derive] },
    short_biography: { required: true },
    birth: { validate: [Function: validate] },
    death: { validate: [Function: validate] }
  }
}

Methods

applyTypeSpecs (metadata, func, replaceValues) inner

If metadata has a property type apply the global specs, else the specifiy specs.

Name Type Default Description
metadata Object
func function

A function with the arguments spec (property specification), value, propName

replaceValues Boolean true

Replace the values in the metadata object.

format (metadata) inner

Name Type Description
metadata Object

isPropertyDerived (propSpec) inner

Name Type Description
propSpec module:@bldr/media-server/meta-types~propSpec

The specification of one property

mergeTypeProps (typeName) inner

Merge the global metadata type specification with a specific type.

Name Type Description
typeName String

The name of the metadata type (for example person)

process (metadata)Object inner

Name Type Description
metadata Object
Returns:
Type Description
Object

sortAndDerive (metadata) inner

Name Type Description
metadata Object

validate (metadata) inner

Name Type Description
metadata Object

Type Definitions

propSpec Object

The specification of a property.

Properties:
Name Type Description
required Boolean
derive function
useDerivedIfEmpty Boolean

Only use the value obtained from the derive function if the original value is empty.

format function
validate function

propSpecs Object

The specification of all properties. The single propSpecs are indexed by the propName.

const propSpecs = {
  id: propSpec
  title: propSpec
}

typeSpec Object

The specification of one metadata type.

Properties:
Name Type Description
basePath String
detectType Object
props module:@bldr/media-server/meta-types~propSpecs

typeSpecs Object

The specification of all meta types