From dfd84ead5bd5dfbcd7c25d08b816b28b4620ee5a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 30 Jan 2022 15:01:35 -0400 Subject: all-in-one document mode & artist data --- src/thing/artist.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/thing/artist.js (limited to 'src/thing') diff --git a/src/thing/artist.js b/src/thing/artist.js new file mode 100644 index 00000000..bbb2a935 --- /dev/null +++ b/src/thing/artist.js @@ -0,0 +1,48 @@ +import Thing from './thing.js'; + +import { + isDirectory, + isName, + isString, + isURL, + validateArrayItems, + validateReferenceList, +} from './validators.js'; + +export default class Artist extends Thing { + static [Thing.referenceType] = 'artist'; + + static propertyDescriptors = { + // Update & expose + + name: { + flags: {update: true, expose: true}, + + update: { + default: 'Unnamed Artist', + validate: isName + } + }, + + directory: { + flags: {update: true, expose: true}, + update: {validate: isDirectory}, + expose: Thing.directoryExpose + }, + + urls: { + flags: {update: true, expose: true}, + update: {validate: validateArrayItems(isURL)} + }, + + aliasRefs: { + flags: {update: true, expose: true}, + update: {validate: validateReferenceList('artist')} + }, + + contextNotes: { + flags: {update: true, expose: true}, + update: {validate: isString} + }, + }; +} -- cgit 1.3.0-6-gf8a5