Skip to content

Instantly share code, notes, and snippets.

@darrenmothersele
Created June 26, 2020 11:17
Show Gist options
  • Save darrenmothersele/34c28431c5247643b479c653fa53d770 to your computer and use it in GitHub Desktop.
Save darrenmothersele/34c28431c5247643b479c653fa53d770 to your computer and use it in GitHub Desktop.
culturebanked backup
[{"blocks":[{"type":"init"},{"type":"gsheet","simple":true,"key":"https://docs.google.com/spreadsheets/d/1YIQCavPvOzTArBc1d2dlbP3bhHVHI65o3-AEHp_urXA/"},{"type":"grid","gridOptions":{}}],"id":"artWillList","workflowId":"artWillList","adapterName":"culturebanked","created":"2020-06-25T09:18:49.829Z","updated":"2020-06-25T09:18:49.829Z","modified":"2020-06-25T09:18:49.829Z","title":"Art"},{"blocks":[{"type":"form","jsonSchema":{"type":"object","properties":{"asset":{"type":"string","title":"Asset"},"width":{"type":"number","title":"Width (mm)"},"height":{"type":"number","title":"Height (mm)"},"medium":{"type":"string","title":"Medium"},"after":{"type":"string","title":"After"},"location":{"type":"string","title":"Location"},"owner":{"title":"Owner","type":"object","properties":{"name":{"type":"string","title":"Name"},"split":{"type":"number","title":"Split"}}},"beneficiaries":{"title":"Beneficiaries","type":"array","items":{"type":"object","properties":{"name":{"type":"string","title":"Name"},"split":{"type":"number","title":"Split"}}}},"marketPlatforms":{"type":"array","title":"Market platforms","items":{"type":"string"}},"assetManager":{"type":"string","title":"Asset manager"},"license":{"type":"string","title":"License details"}}},"uiSchema":{}},{"type":"http","method":"post","endpoint":{"protocol":"https:","host":"ennw79n14irphsy.m.pipedream.net","pathname":"/"},"payload":"merge(data, { id: uuid() })","onError":{"blocks":[{"type":"debug"}]}},{"type":"debug","open":1,"showContext":false}],"id":"createItem","workflowId":"createItem","adapterName":"culturebanked","created":"2020-06-25T14:37:00.635Z","updated":"2020-06-25T14:37:00.635Z","modified":"2020-06-25T14:37:00.635Z","title":"Create Item"},{"blocks":[{"type":"init"},{"type":"multi","batches":[{"blocks":[{"type":"init"},{"type":"message","title":"Parties"},{"type":"db","operation":"get","adapterName":"culturebanked","schema":"party"},{"type":"grid","columnDefs":[{"headerName":"Name","field":"name"},{"width":200,"resizable":false,"cellRenderer":"workflowRenderer","cellRendererParams":{"blocks":[{"type":"actions","buttons":[{"label":"Edit","blocks":[{"type":"launch","adapter":"culturebanked","workflowId":"editParty","context":{"id":"data.uuid"}}]}]}]}}]}]},{"blocks":[{"type":"init"},{"type":"message","title":"Licenses"},{"type":"db","operation":"get","adapterName":"culturebanked","schema":"license"},{"type":"grid","columnDefs":[{"headerName":"Name","field":"name"},{"width":200,"resizable":false,"cellRenderer":"workflowRenderer","cellRendererParams":{"blocks":[{"type":"actions","buttons":[{"label":"Edit","blocks":[{"type":"launch","adapter":"culturebanked","workflowId":"editLicense","context":{"id":"data.uuid"}}]}]}]}}]}]},{"blocks":[{"type":"init"},{"type":"message","title":"Market platforms"},{"type":"db","operation":"get","adapterName":"culturebanked","schema":"platform"},{"type":"grid","columnDefs":[{"headerName":"Name","field":"name"},{"width":200,"resizable":false,"cellRenderer":"workflowRenderer","cellRendererParams":{"blocks":[{"type":"actions","buttons":[{"label":"Edit","blocks":[{"type":"launch","adapter":"culturebanked","workflowId":"editPlatform","context":{"id":"data.uuid"}}]}]}]}}]}]},{"blocks":[{"type":"init"},{"type":"message","title":"Works"},{"type":"db","operation":"get","adapterName":"culturebanked","schema":"work"},{"type":"grid","columnDefs":[{"headerName":"Asset","field":"asset"},{"headerName":"Medium","field":"medium"},{"width":200,"resizable":false,"cellRenderer":"workflowRenderer","cellRendererParams":{"blocks":[{"type":"actions","buttons":[{"label":"Edit","blocks":[{"type":"launch","adapter":"culturebanked","workflowId":"editWork","context":{"id":"data.uuid"}}]}]}]}}]}]}]}],"id":"database","workflowId":"database","adapterName":"culturebanked","created":"2020-06-26T09:05:12.034Z","updated":"2020-06-26T09:05:12.033Z","modified":"2020-06-26T09:05:12.033Z","title":"Database"},{"blocks":[{"type":"init"},{"type":"gsheet","simple":true,"key":"https://docs.google.com/spreadsheets/d/1YIQCavPvOzTArBc1d2dlbP3bhHVHI65o3-AEHp_urXA/"},{"type":"debug","open":0,"showContext":false},{"type":"mapping","mapping":"data[0].{asset: Asset, width: \"Width (mm)\", height: \"Height (mm)\", medium: Medium, after: After, location: Location, owner: { name: Owner, split: \"Financial Splits Rights Owner\"}, marketPlatforms: \"Market Platform(s)\".split(@, ','), beneficiaries: Beneficiaries.split(@, ',')[].{ name: @} , assetManager: \"Asset Manager\", licenseDetails: \"License Details\" }"},{"type":"debug","open":0,"showContext":false},{"type":"form","jsonSchema":{"type":"object","properties":{"asset":{"type":"string","title":"Asset"},"width":{"type":"number","title":"Width (mm)"},"height":{"type":"number","title":"Height (mm)"},"medium":{"type":"string","title":"Medium"},"after":{"type":"string","title":"After"},"location":{"type":"string","title":"Location"},"owner":{"title":"Owner","type":"object","properties":{"name":{"type":"string","title":"Name"},"split":{"type":"string","title":"Split"}}},"beneficiaries":{"title":"Beneficiaries","type":"array","items":{"type":"object","properties":{"name":{"type":"string","title":"Name"},"split":{"type":"string","title":"Split"}}}},"marketPlatforms":{"type":"array","title":"Market platforms","items":{"type":"string"}},"assetManager":{"type":"string","title":"Asset manager"},"licenseDetails":{"type":"string","title":"License details"}}},"uiSchema":{"location":{"ui:widget":"remote-image"}}}],"id":"editItem","workflowId":"editItem","adapterName":"culturebanked","created":"2020-06-25T15:23:36.837Z","updated":"2020-06-25T15:23:36.837Z","modified":"2020-06-25T15:23:36.837Z","title":"Edit Item"},{"blocks":[{"type":"init"},{"type":"db","operation":"fetch","adapterName":"culturebanked","schema":"license","uuidGetter":"context.queryParams.id"},{"type":"mapping","mapping":"data[0]"},{"type":"form","jsonSchema":{"type":"object","properties":{"name":{"title":"Name","type":"string"}}},"uiSchema":{}},{"type":"db","operation":"update","adapterName":"culturebanked","schema":"license"},{"type":"launch","workflowId":"database","adapter":"culturebanked"}],"id":"editLicense","workflowId":"editLicense","adapterName":"culturebanked","created":"2020-06-26T10:27:49.003Z","updated":"2020-06-26T10:27:49.002Z","modified":"2020-06-26T10:27:49.002Z","title":"Edit License Details"},{"blocks":[{"type":"init"},{"type":"db","operation":"fetch","adapterName":"culturebanked","schema":"party","uuidGetter":"context.queryParams.id"},{"type":"mapping","mapping":"data[0]"},{"type":"form","jsonSchema":{"type":"object","properties":{"name":{"title":"Name","type":"string"}}},"uiSchema":{}},{"type":"db","operation":"update","adapterName":"culturebanked","schema":"party"},{"type":"launch","workflowId":"database","adapter":"culturebanked"}],"id":"editParty","workflowId":"editParty","adapterName":"culturebanked","created":"2020-06-26T10:18:10.110Z","updated":"2020-06-26T10:18:10.110Z","modified":"2020-06-26T10:18:10.110Z","title":"Edit Party Details"},{"blocks":[{"type":"init"},{"type":"db","operation":"fetch","adapterName":"culturebanked","schema":"platform","uuidGetter":"context.queryParams.id"},{"type":"mapping","mapping":"data[0]"},{"type":"form","jsonSchema":{"type":"object","properties":{"name":{"title":"Name","type":"string"}}},"uiSchema":{}},{"type":"db","operation":"update","adapterName":"culturebanked","schema":"platform"},{"type":"launch","workflowId":"database","adapter":"culturebanked"}],"id":"editPlatform","workflowId":"editPlatform","adapterName":"culturebanked","created":"2020-06-26T10:28:24.804Z","updated":"2020-06-26T10:28:24.804Z","modified":"2020-06-26T10:28:24.804Z","title":"Edit Market Platform Details"},{"blocks":[{"type":"init"},{"type":"db","operation":"fetch","adapterName":"culturebanked","schema":"work","uuidGetter":"context.queryParams.id"},{"type":"mapping","mapping":"data[0]"},{"type":"form","jsonSchema":{"type":"object","properties":{"asset":{"title":"Asset","type":"string"},"width":{"title":"Width (mm)","type":"string"},"height":{"title":"Height (mm)","type":"string"},"medium":{"title":"Medium","type":"string"},"after":{"title":"After","type":"string"},"location":{"title":"Location","type":"string"},"owner":{"title":"Owner","type":"array","items":{"type":"object","properties":{"partyId":{"type":"string","title":"Party"},"split":{"type":"string","title":"split"}}}},"beneficiaries":{"title":"Beneficiaries","type":"array","items":{"type":"object","properties":{"partyId":{"type":"string","title":"Party"},"split":{"type":"string","title":"split"}}}},"marketPlatforms":{"type":"array","title":"Market platforms","items":{"type":"string"}},"assetManager":{"type":"string","title":"Asset manager"},"licenseDetails":{"type":"string","title":"License details"}}},"uiSchema":{"location":{"ui:widget":"remote-image"},"assetManager":{"ui:widget":"blocks","blocksConfig":{"blocks":[{"type":"context-save","contextKey":"defaultValue"},{"type":"db","skipFirst":false,"operation":"get","adapterName":"culturebanked","schema":"party"},{"type":"reference","fieldLabel":"Select asset manager","labelGetter":"name","valueField":"uuid","outputGetter":"uuid"}]}},"licenseDetails":{"ui:widget":"blocks","blocksConfig":{"blocks":[{"type":"context-save","contextKey":"defaultValue"},{"type":"db","skipFirst":false,"operation":"get","adapterName":"culturebanked","schema":"license"},{"type":"reference","fieldLabel":"Select license","labelGetter":"name","valueField":"uuid","outputGetter":"uuid"}]}},"marketPlatforms":{"items":{"ui:widget":"blocks","blocksConfig":{"blocks":[{"type":"context-save","contextKey":"defaultValue"},{"type":"db","skipFirst":false,"operation":"get","adapterName":"culturebanked","schema":"platform"},{"type":"reference","fieldLabel":"Select market platform","labelGetter":"name","valueField":"uuid","outputGetter":"uuid"}]}}},"owner":{"ui:widget":"table","colHeadings":["Owner","Split"],"items":{"partyId":{"ui:widget":"blocks","blocksConfig":{"blocks":[{"type":"context-save","contextKey":"defaultValue"},{"type":"db","skipFirst":false,"operation":"get","adapterName":"culturebanked","schema":"party"},{"type":"reference","fieldLabel":"Select owner","labelGetter":"name","valueField":"uuid","outputGetter":"uuid"}]}}}},"beneficiaries":{"ui:widget":"table","colHeadings":["Beneficiary","Split"],"items":{"partyId":{"ui:widget":"blocks","blocksConfig":{"blocks":[{"type":"context-save","contextKey":"defaultValue"},{"type":"db","skipFirst":false,"operation":"get","adapterName":"culturebanked","schema":"party"},{"type":"reference","fieldLabel":"Select beneficiary","labelGetter":"name","valueField":"uuid","outputGetter":"uuid"}]}}}}}},{"type":"db","operation":"update","adapterName":"culturebanked","schema":"work"},{"type":"launch","workflowId":"database","adapter":"culturebanked"}],"id":"editWork","workflowId":"editWork","adapterName":"culturebanked","created":"2020-06-26T10:29:18.509Z","updated":"2020-06-26T10:29:18.508Z","modified":"2020-06-26T10:29:18.508Z","title":"Edit Work Details"},{"blocks":[{"type":"init"},{"type":"gsheet","simple":true,"key":"https://docs.google.com/spreadsheets/d/1YIQCavPvOzTArBc1d2dlbP3bhHVHI65o3-AEHp_urXA/"},{"type":"grid","gridOptions":{"pagination":true,"paginationPageSize":25,"rowSelection":"multiple","suppressRowClickSelection":true},"columnDefs":[{"headerCheckboxSelection":true,"checkboxSelection":true},{"headerName":"Asset","field":"Asset"},{"headerName":"Medium","field":"Medium"},{"headerName":"After","field":"After"},{"headerName":"Owner","field":"Owner"},{"headerName":"Market Platforms","field":"Market Platform(s)"}]},{"type":"message","message":"{{#if data.length}}{{data.length}} items selected{{/if}}"},{"type":"mapping","mapping":"data[*].{asset: trim(Asset), width: trim(\"Width (mm)\"), height: trim(\"Height (mm)\"), medium: trim(Medium), after: trim(After), location: trim(Location), owner: Owner.split(@, ',')[].{ name: trim(@) }, marketPlatforms: \"Market Platform(s)\".split(@, ',')[].trim(@), beneficiaries: Beneficiaries.split(@, ',')[].{ name: trim(@) } , assetManager: trim(\"Asset Manager\"), licenseDetails: trim(\"License Details\") }"},{"type":"multi","batches":[{"blocks":[{"type":"mapping","mapping":"data && uniq(data[].[owner[].name, beneficiaries[].name, assetManager][][])"}]},{"blocks":[{"type":"mapping","mapping":"data && uniq(data[].licenseDetails)"}]},{"blocks":[{"type":"mapping","mapping":"data && uniq(data[].marketPlatforms[][])[?length(@) > `0`]"}]},{"blocks":[{"type":"mapping","mapping":"data"}]}]},{"type":"mapping","mapping":"data && { parties: data[0][].{ type: `party`, id: uuid(), name: @ }, licenses: data[1][].{ type: `license`, id: uuid(), name: @ }, marketPlatforms: data[2][].{ type: `platform`, id: uuid(), name: @ }, works: data[3][].merge(@, { id: uuid(), type: `work` }) }"},{"type":"mapping","mapping":"data && merge(data,{ works: data.works[].merge(@, { assetManager: find($.data.parties, 'name', assetManager).id, owner: owner[].find($.data.parties, 'name', name).{ partyId: id, split: `0` }, marketPlatforms: marketPlatforms[].find($.data.marketPlatforms, 'name', @).id, beneficiaries: beneficiaries[].find($.data.parties, 'name', name).{ partyId: id, split: `0` }, licenseDetails: find($.data.licenses, 'name', licenseDetails).id }) })"},{"type":"mapping","mapping":"data && data.[parties, licenses, marketPlatforms, works][].merge(@, { uuid: id, schema: type })"},{"type":"debug","open":0,"showContext":false},{"type":"actions","buttons":[{"label":"Import","color":"primary","blocks":[{"type":"batch","blocks":[{"type":"debug","consoleLog":true},{"type":"db","skipFirst":false,"operation":"add","schemaGetter":"data.type","adapterName":"culturebanked"}]}]}]},{"type":"debug","open":0,"showContext":false}],"id":"import","workflowId":"import","adapterName":"culturebanked","created":"2020-06-26T10:34:53.524Z","updated":"2020-06-26T10:34:53.524Z","modified":"2020-06-26T10:34:53.524Z","title":"Art (Import)"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment