From e8964d7a9f9dc787d4d84c0554d22149bb2daa0c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 31 Mar 2025 15:04:20 -0300 Subject: data: Artwork, constitutibleArtwork, etc Not used in content yet. --- .../composite/wiki-data/withConstitutedArtwork.js | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/data/composite/wiki-data/withConstitutedArtwork.js (limited to 'src/data/composite/wiki-data/withConstitutedArtwork.js') diff --git a/src/data/composite/wiki-data/withConstitutedArtwork.js b/src/data/composite/wiki-data/withConstitutedArtwork.js new file mode 100644 index 00000000..9843588a --- /dev/null +++ b/src/data/composite/wiki-data/withConstitutedArtwork.js @@ -0,0 +1,44 @@ +import {input, templateCompositeFrom} from '#composite'; +import thingConstructors from '#things'; +import {isContributionList} from '#validators'; + +export default templateCompositeFrom({ + annotation: `withConstitutedArtwork`, + + inputs: { + contribsProperty: input({type: 'string'}), + artistProperty: input({type: 'string'}), + dateProperty: input({type: 'string'}), + }, + + outputs: ['#constitutedArtwork'], + + steps: () => [ + { + dependencies: [ + input.myself(), + 'find', + + input('contribsProperty'), + input('dateProperty'), + ], + + compute: (continuation, { + [input.myself()]: myself, + ['find']: find, + + [input('contribsProperty')]: contribsProperty, + [input('dateProperty')]: dateProperty, + }) => continuation({ + ['#constitutedArtwork']: + Object.assign(new thingConstructors.Artwork, { + thing: myself, + find: find, + + artistContribsFromThingProperty: contribsProperty, + dateFromThingProperty: dateProperty, + }), + }), + }, + ], +}); -- cgit 1.3.0-6-gf8a5