{
  "name": "bloomen",
  "label": "Bloomen",
  "description": "Integration with the Bloomen project",
  "version": "0.0.0",
  "infoUrl": "http://bloomen.io/",
  "maintainer": "Kendraio",
  "supportUrl": "http://kendra.io",
  "database": [
    {
      "name": "user",
      "schema": "schemas/user.schema.json"
    },
    {
      "name": "photo",
      "schema": "schemas/photo.schema.json"
    }
  ],
  "dashboard": {
    "icon": "brightness_5",
    "label": "Bloomen",
    "workflowId": "users"
  },
  "services": [
    {
      "label": "Login",
      "icon": "person",
      "workflowId": "login"
    },
    {
      "label": "Users",
      "icon": "people",
      "workflowId": "users"
    },
    {
      "label": "Content Search",
      "icon": "search",
      "workflowId": "search"
    },
    {
      "label": "Import File",
      "icon": "file_copy",
      "workflowId": "importFromFile"
    },
    {
      "label": "Musical Works",
      "icon": "music_note",
      "workflowId": "listWorks"
    },
    {
      "label": "Sound Recordings",
      "icon": "music_note",
      "workflowId": "listSoundRecordings"
    },
    {
      "label": "Bulk Import",
      "icon": "music_note",
      "workflowId": "importRecordings"
    }
  ],
  "workflow": [
    {
      "title": "Edit user",
      "workflowId": "editUser",
      "config": "configs/editUser.json"
    },
    {
      "title": "Edit work",
      "workflowId": "editWork",
      "config": "configs/editWork.json"
    },
    {
      "title": "View Musical Work",
      "workflowId": "viewWork",
      "config": "configs/viewWork.json"
    },
    {
      "title": "Musical Work (Versions)",
      "workflowId": "workVersions",
      "config": "configs/workVersions.json"
    },
    {
      "title": "Export works",
      "workflowId": "exportWorks",
      "config": "configs/exportWorks.json"
    },
    {
      "title": "Import from file",
      "workflowId": "importFromFile",
      "config": "configs/importFromFile.json"
    },
    {
      "title": "Import works",
      "workflowId": "importWorks",
      "config": "configs/importWorks.json"
    },
    {
      "title": "List works",
      "workflowId": "listWorks",
      "config": "configs/listWorks.json"
    },
    {
      "title": "Login",
      "workflowId": "login",
      "config": "configs/login.json"
    },
    {
      "title": "Register",
      "workflowId": "register",
      "config": "configs/register.json"
    },
    {
      "title": "Search",
      "workflowId": "search",
      "config": "configs/search.json"
    },
    {
      "title": "Users",
      "workflowId": "users",
      "config": "configs/users.json"
    },
    {
      "title": "List of Sound Recordings",
      "workflowId": "listSoundRecordings",
      "config": "configs/listSoundRecordings.json"
    },
    {
      "title": "List Musical Works",
      "workflowId": "listMusicalWorks",
      "config": "configs/listMusicalWorks.json"
    },
    {
      "title": "Chart of releases per work",
      "config": "configs/chartReleases.json",
      "workflowId": "chartReleases"
    },
    {
      "title": "Edit Sound Recording",
      "workflowId": "editSoundRecording",
      "config": "configs/editSoundRecording.json"
    },
    {
      "title": "Message block example",
      "workflowId": "messageExample",
      "config": "configs/messageExample.json"
    },
    {
      "title": "Query and template example",
      "workflowId": "templateExample",
      "config": "configs/templateExample.json"
    },
    {
      "title": "Musical works (Dialog view)",
      "workflowId": "dialogExample",
      "config": "configs/dialogExample.json"
    },
    {
      "title": "List works (Bloomen API)",
      "workflowId": "bloomenApiJwt-musicalWorks",
      "config": "configs/bloomenApiJwt-musicalWorks.json"
    },
    {
      "title": "List recordings (Bloomen API)",
      "workflowId": "bloomenApiJwt-soundRecordings",
      "config": "configs/bloomenApiJwt-soundRecordings.json"
    },
    {
      "workflowId": "bloomenApiJwt-exportMusicalWorks",
      "title": "Export works CSV (Bloomen API)",
      "config": "configs/bloomenApiJwt-exportMusicalWorks.json"
    },
    {
      "title": "Photo search (Bloomen API)",
      "workflowId": "photo-search-example",
      "config": "configs/photo-search-example.json"
    },
    {
      "title": "Import works (Bloomen API)",
      "workflowId": "importMusicalWorks",
      "config": "configs/importMusicalWorks.json"
    },
    {
      "title": "Import recordings (Bloomen API)",
      "workflowId": "importRecordings",
      "config": "configs/importRecordings.json"
    },
    {
      "title": "List of Sound Recordings (view/edit)",
      "workflowId": "listSoundRecordings-view-edit",
      "config": "configs/listSoundRecordings-view-edit.json"
    },
    {
      "title": "Bulk Import",
      "workflowId": "bulkImport",
      "config": "configs/bulkImport.json"
    },
    {
      "title": "Select Organisation",
      "workflowId": "selectOrganisation",
      "config": "configs/selectOrganisation.json"
    }
  ],
  "forms": [
    {
      "formId": "musicalWork",
      "title": "Bloomen MusicalWork",
      "jsonSchema": "schemas/musicalWork.schema.json",
      "uiSchema": "forms/musicalWork.ui.json"
    },
    {
      "formId": "soundRecording",
      "title": "Bloomen SoundRecording",
      "jsonSchema": "schemas/soundRecording.schema.json",
      "uiSchema": "forms/soundRecording.ui.json"
    },
    {
      "formId": "user",
      "title": "Bloomen User",
      "jsonSchema": "schemas/user.schema.json",
      "uiSchema": "forms/user.ui.json"
    },
    {
      "formId": "photo",
      "title": "Bloomen Photo",
      "jsonSchema": "schemas/photo.schema.json",
      "uiSchema": "forms/photo.ui.json"
    }
  ],
  "upload": {
    "enabled": true
  },
  "apis": [
    "swagger/api-docs.json"
  ],
  "tags": [
    "music",
    "b2b",
    "photos",
    "webtv",
    "demo"
  ],
  "attachments": {
    "configs/bloomenApiJwt-exportMusicalWorks.json": {
      "title": "Export works CSV (Bloomen API)",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "context",
          "contextPath": "bloomenAuth",
          "contextBlocks": [
            {
              "type": "variable-get",
              "name": "bloomenAuth"
            }
          ],
          "blocks": [
            {
              "type": "http",
              "method": "get",
              "endpoint": {
                "protocol": "https:",
                "host": "bloomen.herokuapp.com",
                "pathname": "/sound/music"
              },
              "authentication": {
                "type": "bearer",
                "valueGetters": {
                  "jwt": "context.bloomenAuth"
                }
              }
            }
          ]
        },
        {
          "type": "mapping",
          "mapping": "data[].{ id: id, title: originalTitle, creators: creators[].name, alternativeTitles: alternativeTitles, performers: associatedPerformers, isrcs: associatedISRCs, ISWC: ISWC }"
        },
        {
          "type": "csv-export",
          "header": true,
          "skipEmptyLines": true
        }
      ]
    },
    "configs/bloomenApiJwt-musicalWorks.json": {
      "title": "List works (Bloomen API)",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "context",
          "contextPath": "bloomenAuth",
          "contextBlocks": [
            {
              "type": "variable-get",
              "name": "bloomenAuth"
            }
          ],
          "blocks": [
            {
              "type": "http",
              "method": "get",
              "endpoint": {
                "protocol": "https:",
                "host": "bloomen.herokuapp.com",
                "pathname": "/sound/music"
              },
              "authentication": {
                "type": "bearer",
                "valueGetters": {
                  "jwt": "context.bloomenAuth"
                }
              }
            }
          ]
        },
        {
          "type": "grid",
          "columnDefs": [
            {
              "headerName": "ISWC",
              "field": "ISWC"
            },
            {
              "headerName": "Title",
              "valueGetter": "originalTitle"
            },
            {
              "headerName": "Creators",
              "valueGetter": "creators[].name"
            },
            {
              "headerName": "Alternative titles",
              "valueGetter": "alternativeTitles"
            }
          ]
        }
      ]
    },
    "configs/bloomenApiJwt-soundRecordings.json": {
      "title": "List recordings (Bloomen API)",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "context",
          "contextPath": "bloomenAuth",
          "contextBlocks": [
            {
              "type": "variable-get",
              "name": "bloomenAuth"
            }
          ],
          "blocks": [
            {
              "type": "http",
              "method": "get",
              "endpoint": {
                "protocol": "https:",
                "host": "bloomen.herokuapp.com",
                "pathname": "/sound/recordings"
              },
              "authentication": {
                "type": "bearer",
                "valueGetters": {
                  "jwt": "context.bloomenAuth"
                }
              }
            }
          ]
        },
        {
          "type": "grid",
          "columnDefs": [
            {
              "headerName": "ISRC",
              "field": "ISRC"
            },
            {
              "headerName": "Title",
              "valueGetter": "title"
            },
            {
              "headerName": "Artist",
              "valueGetter": "mainArtist"
            },
            {
              "headerName": "Year",
              "valueGetter": "yearOfRecording"
            },
            {
              "headerName": "Featured artists",
              "valueGetter": "featuredArtists"
            }
          ]
        }
      ]
    },
    "configs/bulkImport.json": {
      "title": "Bulk Import",
      "blocks": [
        {
          "type": "file-input",
          "label": "Import",
          "accept": [
            "csv",
            "json",
            "xml"
          ]
        },
        {
          "type": "parse-data",
          "csvOptions": {
            "header": true,
            "skipEmptyLines": true,
            "dynamicTyping": false,
            "transform": false
          },
          "xmlOptions": {}
        },
        {
          "type": "mapping",
          "mapping": "data[:10]"
        },
        {
          "type": "debug",
          "open": 0,
          "showContext": false
        },
        {
          "type": "grid",
          "gridOptions": {
            "pagination": true,
            "rowSelection": "multiple"
          }
        },
        {
          "type": "mapping",
          "mapping": "{ items: data }"
        },
        {
          "type": "form",
          "label": "Import",
          "jsonSchema": {
            "properties": {
              "organisation": {
                "type": "string",
                "title": "Organisation"
              }
            }
          },
          "uiSchema": {
            "organisation": {
              "ui:widget": "blocks",
              "blocksConfig": {
                "blocks": [
                  {
                    "type": "gosub",
                    "adapterName": "bloomen",
                    "workflowId": "selectOrganisation"
                  }
                ]
              }
            }
          }
        },
        {
          "type": "debug",
          "open": 1,
          "showContext": false
        }
      ],
      "id": "bulkImport",
      "adapterName": "bloomen"
    },
    "configs/chartReleases.json": {
      "title": "Chart of releases per work",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "query",
          "dataSource": {
            "type": "remote",
            "endpoint": "https://fake-api.now32.now.sh/musicalWork"
          }
        },
        {
          "type": "mapping",
          "mapping": "data[].{ label: originalTitle, value: length(associatedISRCs) }"
        },
        {
          "type": "chart",
          "columnDefs": [
            {
              "headerName": "Title",
              "field": "label"
            },
            {
              "headerName": "Releases",
              "field": "value"
            }
          ]
        }
      ]
    },
    "configs/dialogExample.json": {
      "title": "Musical works (Dialog view)",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "query",
          "dataSource": {
            "type": "remote",
            "endpoint": "https://fake-api.now32.now.sh/musicalWork"
          }
        },
        {
          "type": "grid",
          "columnDefs": [
            {
              "headerName": "ISWC",
              "field": "ISWC",
              "checkboxSelection": true
            },
            {
              "headerName": "Title",
              "field": "originalTitle"
            }
          ]
        },
        {
          "type": "mapping",
          "mapping": "[0]"
        },
        {
          "type": "button",
          "label": "View",
          "blocks": [
            {
              "type": "template",
              "template": "<h1>{{originalTitle}}</h1><p>This musical work has ISWC {{ISWC}} and {{associatedISRCs.length}} related recordings.</p><p>Performers:</p><ul>{{#each associatedPerformers}}<li>{{this}}</li>{{/each}}</ul><p>Associated ISRCs:</p><ul>{{#each associatedISRCs}}<li>{{this}}</li>{{/each}}</ul>"
            },
            {
              "type": "form",
              "label": "Save",
              "jsonSchema": {
                "type": "object"
              },
              "uiSchema": {}
            }
          ]
        },
        {
          "type": "debug"
        }
      ]
    },
    "configs/editOrganisation.json": {
      "title": "Edit Organisation (Bloomen API)",
      "blocks": [
        {
          "type": "switch",
          "valueGetter": "contains(['music'], context.queryParams.name)",
          "default": {
            "blocks": [
              {
                "type": "message",
                "message": "Restricted"
              }
            ]
          },
          "cases": [
            {
              "value": true,
              "blocks": [
                {
                  "type": "init"
                },
                {
                  "type": "variable-get",
                  "name": "bloomenAuth"
                },
                {
                  "type": "context-save",
                  "contextKey": "bloomenAuth"
                },
                {
                  "type": "http",
                  "method": "get",
                  "notify": false,
                  "endpoint": {
                    "protocol": "https:",
                    "host": "bloomen.herokuapp.com",
                    "valueGetters": {
                      "pathname": "join('', ['/organisations/', context.queryParams.name])"
                    }
                  },
                  "authentication": {
                    "type": "bearer",
                    "valueGetters": {
                      "jwt": "context.bloomenAuth"
                    }
                  }
                },
                {
                  "type": "message",
                  "message": "Edit group for {{ context.queryParams.name }}"
                },
                {
                  "type": "form",
                  "label": "Save",
                  "jsonSchema": {
                    "type": "object",
                    "properties": {
                      "group": {
                        "type": "string",
                        "title": "Group"
                      }
                    }
                  },
                  "uiSchema": {}
                },
                {
                  "type": "mapping",
                  "mapping": "data.omit(@, ['_id', '__v'])"
                },
                {
                  "type": "http",
                  "method": "put",
                  "notify": true,
                  "skipInit": true,
                  "firstChange": true,
                  "endpoint": {
                    "protocol": "https:",
                    "host": "bloomen.herokuapp.com",
                    "valueGetters": {
                      "pathname": "join('', ['/organisations/', context.queryParams.name])"
                    }
                  },
                  "authentication": {
                    "type": "bearer",
                    "valueGetters": {
                      "jwt": "context.bloomenAuth"
                    }
                  }
                }
              ]
            }
          ]
        }
      ],
      "id": "editOrganisation",
      "adapterName": "bloomen"
    },
    "configs/editSoundRecording.json": {
      "title": "Edit Sound Recording",
      "blocks": [
        {
          "type": "form",
          "jsonSchema": {
            "properties": {
              "id": {
                "type": "string"
              }
            }
          },
          "uiSchema": {
            "id": {
              "ui:placeholder": "ID"
            }
          }
        },
        {
          "type": "query",
          "dataSource": {
            "type": "remote",
            "endpoint": {
              "protocol": "https:",
              "host": "fake-api.now32.now.sh",
              "valueGetters": {
                "pathname": "join('', ['/soundRecording/', model.id])"
              }
            }
          }
        },
        {
          "type": "debug"
        },
        {
          "type": "form",
          "adapter": "bloomen",
          "formId": "soundRecording"
        },
        {
          "type": "http",
          "method": "put",
          "endpoint": {
            "protocol": "https:",
            "host": "fake-api.now32.now.sh",
            "valueGetters": {
              "pathname": "join('', ['/soundRecording/', to_string(model.id)])"
            }
          }
        },
        {
          "type": "debug"
        }
      ]
    },
    "configs/editUser.json": {
      "title": "Edit user",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "notify": false,
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "valueGetters": {
              "pathname": "join('', ['/users/', context.queryParams.hash, '/kyc'])"
            }
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "form",
          "label": "Save",
          "adapter": "bloomen",
          "formId": "user"
        },
        {
          "type": "mapping",
          "mapping": "data.omit(@, ['_id', '__v'])"
        },
        {
          "type": "http",
          "method": "put",
          "notify": true,
          "skipInit": true,
          "firstChange": true,
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "valueGetters": {
              "pathname": "join('', ['/users/', context.queryParams.hash])"
            }
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        }
      ],
      "id": "editUser",
      "adapterName": "bloomen"
    },
    "configs/editWork.json": {
      "title": "Edit work",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "notify": false,
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "valueGetters": {
              "pathname": "join('', ['/sound/music/', context.queryParams.id])"
            }
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "form",
          "label": "Save",
          "adapter": "bloomen",
          "formId": "musicalWork"
        },
        {
          "type": "http",
          "method": "put",
          "notify": true,
          "firstChange": true,
          "skipInit": true,
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "valueGetters": {
              "pathname": "join('', ['/sound/music/', context.queryParams.id])"
            }
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "launch",
          "adapter": "bloomen",
          "workflowId": "listWorks"
        }
      ],
      "id": "editWork",
      "adapterName": "bloomen"
    },
    "configs/exportWorks.json": {
      "title": "Export works",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "http",
          "method": "get",
          "notify": false,
          "endpoint": "https://fake-api.now32.now.sh/musicalWork"
        },
        {
          "type": "grid",
          "gridOptions": {
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "checkboxSelection": true,
              "width": 70,
              "suppressSizeToFit": true
            },
            {
              "headerName": "Title",
              "field": "originalTitle"
            },
            {
              "headerName": "ISWC",
              "field": "ISWC"
            }
          ]
        }
      ]
    },
    "configs/importFromFile.json": {
      "title": "Import from file",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "message",
          "title": "Import items",
          "message": "Select file to import items into Bloomen API."
        },
        {
          "type": "file-input",
          "label": "Load file",
          "accept": [
            "json"
          ]
        },
        {
          "type": "parse-data"
        },
        {
          "type": "grid",
          "gridOptions": {
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "checkboxSelection": true,
              "width": 70,
              "suppressSizeToFit": true
            },
            {
              "headerName": "Title",
              "field": "originalTitle"
            },
            {
              "headerName": "ISWC",
              "field": "ISWC"
            }
          ]
        },
        {
          "type": "mapping",
          "mapping": "{ data: data }"
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Import",
              "color": "primary",
              "blocks": [
                {
                  "type": "http",
                  "skipInit": false,
                  "method": "post",
                  "endpoint": {
                    "protocol": "https:",
                    "host": "bloomen.herokuapp.com",
                    "pathname": "/sound/bulk"
                  },
                  "authentication": {
                    "type": "bearer",
                    "valueGetters": {
                      "jwt": "context.bloomenAuth"
                    }
                  }
                }
              ]
            }
          ]
        }
      ],
      "id": "importFromFile",
      "adapterName": "bloomen"
    },
    "configs/importMusicalWorks.json": {
      "title": "Import works (Bloomen API)",
      "blocks": [
        {
          "type": "csv-import",
          "header": true,
          "skipEmptyLines": true
        },
        {
          "type": "grid",
          "gridOptions": {
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "headerName": "id",
              "field": "id",
              "checkboxSelection": true
            },
            {
              "headerName": "title",
              "field": "title"
            },
            {
              "headerName": "creators",
              "field": "creators"
            },
            {
              "headerName": "alternativeTitles",
              "field": "alternativeTitles"
            },
            {
              "headerName": "performers",
              "field": "performers"
            },
            {
              "headerName": "ISRCs",
              "field": "isrcs"
            },
            {
              "headerName": "ISWC",
              "field": "ISWC"
            }
          ]
        },
        {
          "type": "debug"
        }
      ]
    },
    "configs/importRecordings.json": {
      "title": "Import recordings (Bloomen API)",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "pathname": "/organisations/groups"
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "mapping",
          "mapping": "data[].{ value: @, label: @ }"
        },
        {
          "type": "context-save",
          "contextKey": "groups"
        },
        {
          "type": "mapping",
          "mapping": "context.groups"
        },
        {
          "type": "reference",
          "fieldLabel": "Group",
          "valueField": "value"
        },
        {
          "type": "context-save",
          "contextKey": "selectedGroup"
        },
        {
          "type": "csv-import",
          "header": true,
          "skipEmptyLines": true
        },
        {
          "type": "grid",
          "gridOptions": {
            "pagination": true,
            "paginationPageSize": 25,
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "headerCheckboxSelection": true,
              "checkboxSelection": true
            },
            {
              "headerName": "Title",
              "field": "title"
            },
            {
              "headerName": "Artist",
              "field": "mainArtist"
            },
            {
              "headerName": "ISRC",
              "field": "ISRC"
            }
          ]
        },
        {
          "type": "mapping",
          "mapping": "{ data: data[].merge(@, { group: _(&context.selectedGroup) }) }"
        },
        {
          "type": "form",
          "label": "Import",
          "jsonSchema": {},
          "uiSchema": {}
        },
        {
          "type": "debug",
          "open": 0
        },
        {
          "type": "http",
          "skipInit": false,
          "method": "post",
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "pathname": "/sound/bulk"
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        }
      ],
      "id": "importRecordings",
      "adapterName": "bloomen"
    },
    "configs/importWorks.json": {
      "title": "Import works",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "http",
          "method": "get",
          "notify": false,
          "endpoint": "https://fake-api.now32.now.sh/musicalWork"
        },
        {
          "type": "message",
          "title": "Copy items",
          "message": "Select items from Kendraio API to import into Bloomen API."
        },
        {
          "type": "grid",
          "gridOptions": {
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "checkboxSelection": true,
              "width": 70,
              "suppressSizeToFit": true
            },
            {
              "headerName": "Title",
              "field": "originalTitle"
            },
            {
              "headerName": "ISWC",
              "field": "ISWC"
            }
          ]
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Import",
              "color": "primary",
              "blocks": [
                {
                  "type": "batch",
                  "blocks": [
                    {
                      "type": "context",
                      "contextPath": "bloomenAuth",
                      "contextBlocks": [
                        {
                          "type": "variable-get",
                          "name": "bloomenAuth"
                        }
                      ],
                      "blocks": [
                        {
                          "type": "http",
                          "skipInit": false,
                          "method": "post",
                          "endpoint": {
                            "protocol": "https:",
                            "host": "bloomen.herokuapp.com",
                            "pathname": "/sound/music"
                          },
                          "authentication": {
                            "type": "bearer",
                            "valueGetters": {
                              "jwt": "context.bloomenAuth"
                            }
                          }
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "id": "importWorks"
    },
    "configs/listGroups.json": {
      "title": "Groups",
      "blocks": [
        {
          "type": "message",
          "title": "Groups (Bloomen API)"
        },
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "pathname": "/organisations/groups"
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "debug"
        }
      ],
      "id": "listGroups",
      "adapterName": "bloomen"
    },
    "configs/listMusicalWorks.json": {
      "title": "List Musical Works",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "query",
          "dataSource": {
            "type": "remote",
            "endpoint": "https://fake-api.now32.now.sh/musicalWork"
          }
        },
        {
          "type": "grid",
          "columnDefs": [
            {
              "headerName": "Title",
              "field": "originalTitle"
            },
            {
              "headerName": "ISWC",
              "field": "ISWC"
            }
          ]
        }
      ]
    },
    "configs/listOrganisations.json": {
      "title": "Organisations",
      "blocks": [
        {
          "type": "message",
          "title": "Organisations (Bloomen API)"
        },
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "pathname": "/organisations"
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "grid",
          "gridOptions": {
            "pagination": true,
            "paginationPageSize": 50,
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "width": 50,
              "resizable": false,
              "checkboxSelection": true
            },
            {
              "headerName": "ID",
              "field": "_id"
            },
            {
              "headerName": "Name",
              "field": "name"
            },
            {
              "headerName": "Group",
              "field": "group"
            },
            {
              "headerName": "Hash",
              "field": "hash"
            },
            {
              "headerName": "Wallet",
              "field": "walletAddress"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Edit",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "bloomen",
                            "workflowId": "editOrganisation",
                            "context": {
                              "name": "data.name"
                            }
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ],
      "id": "listOrganisations",
      "adapterName": "bloomen"
    },
    "configs/listSoundRecordings-view-edit.json": {
      "title": "List of Sound Recordings (view/edit)",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "query",
          "dataSource": {
            "type": "remote",
            "endpoint": "https://fake-api.now32.now.sh/soundRecording"
          }
        },
        {
          "type": "grid",
          "columnDefs": [
            {
              "headerName": "Title",
              "field": "title"
            },
            {
              "headerName": "Artist",
              "field": "mainArtist"
            },
            {
              "headerName": "ISRC",
              "field": "ISRC"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "message",
                                "message": "Viewing {{title}}"
                              },
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": []
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Edit",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "form",
                                "adapter": "bloomen",
                                "formId": "soundRecording"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ]
    },
    "configs/listSoundRecordings.json": {
      "title": "List works",
      "blocks": [
        {
          "type": "message",
          "title": "List of Sound Recordings (Bloomen API)"
        },
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "pathname": "/sound/recordings"
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "grid",
          "gridOptions": {},
          "columnDefs": [
            {
              "headerName": "Title",
              "field": "title"
            },
            {
              "headerName": "ISRC",
              "field": "ISRC"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Edit",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "bloomen",
                            "workflowId": "editWork",
                            "context": {
                              "id": "data.id"
                            }
                          }
                        ]
                      },
                      {
                        "label": "Delete",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "message",
                                "title": "Are you sure you want to delete {{originalTitle}}?",
                                "message": "This action cannot be undone."
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "Delete",
                                    "color": "warn",
                                    "blocks": [
                                      {
                                        "type": "context",
                                        "contextPath": "bloomenAuth",
                                        "contextBlocks": [
                                          {
                                            "type": "variable-get",
                                            "name": "bloomenAuth"
                                          }
                                        ],
                                        "blocks": [
                                          {
                                            "type": "http",
                                            "method": "delete",
                                            "notify": true,
                                            "endpoint": {
                                              "protocol": "https:",
                                              "host": "bloomen.herokuapp.com",
                                              "valueGetters": {
                                                "pathname": "join('', ['/sound/recordings/', data.id])"
                                              }
                                            },
                                            "authentication": {
                                              "type": "bearer",
                                              "valueGetters": {
                                                "jwt": "context.bloomenAuth"
                                              }
                                            }
                                          }
                                        ]
                                      }
                                    ]
                                  },
                                  {
                                    "label": "Cancel",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ],
      "id": "listWorks",
      "adapterName": "bloomen"
    },
    "configs/listWorks.json": {
      "title": "List works",
      "blocks": [
        {
          "type": "message",
          "title": "List of Musical Works (Bloomen API)"
        },
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "pathname": "/sound/music"
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "grid",
          "gridOptions": {
            "pagination": true,
            "paginationPageSize": 10
          },
          "columnDefs": [
            {
              "headerName": "Title",
              "field": "originalTitle"
            },
            {
              "headerName": "ISWC",
              "field": "ISWC"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "mapping",
                                "mapping": "data.omit(@, ['_id', '__v', 'versions'])"
                              },
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Edit",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "bloomen",
                            "workflowId": "editWork",
                            "context": {
                              "id": "data.id"
                            }
                          }
                        ]
                      },
                      {
                        "label": "Versions",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "bloomen",
                            "workflowId": "workVersions",
                            "context": {
                              "id": "data.id"
                            }
                          }
                        ]
                      },
                      {
                        "label": "Delete",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "message",
                                "title": "Are you sure you want to delete {{originalTitle}}?",
                                "message": "This action cannot be undone."
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "Delete",
                                    "color": "warn",
                                    "blocks": [
                                      {
                                        "type": "context",
                                        "contextPath": "bloomenAuth",
                                        "contextBlocks": [
                                          {
                                            "type": "variable-get",
                                            "name": "bloomenAuth"
                                          }
                                        ],
                                        "blocks": [
                                          {
                                            "type": "http",
                                            "method": "delete",
                                            "notify": true,
                                            "endpoint": {
                                              "protocol": "https:",
                                              "host": "bloomen.herokuapp.com",
                                              "valueGetters": {
                                                "pathname": "join('', ['/sound/music/', data.id])"
                                              }
                                            },
                                            "authentication": {
                                              "type": "bearer",
                                              "valueGetters": {
                                                "jwt": "context.bloomenAuth"
                                              }
                                            }
                                          }
                                        ]
                                      }
                                    ]
                                  },
                                  {
                                    "label": "Cancel",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ],
      "id": "listWorks",
      "adapterName": "bloomen"
    },
    "configs/login.json": {
      "title": "Login",
      "blocks": [
        {
          "type": "form",
          "label": "Login",
          "jsonSchema": {
            "type": "object",
            "properties": {
              "username": {
                "type": "string",
                "title": "Username"
              },
              "password": {
                "type": "string",
                "title": "Password"
              }
            }
          },
          "uiSchema": {
            "password": {
              "ui:widget": "password"
            }
          }
        },
        {
          "type": "http",
          "method": "post",
          "notify": false,
          "endpoint": "https://bloomen.herokuapp.com/auth/login"
        },
        {
          "type": "mapping",
          "mapping": "data.token"
        },
        {
          "type": "debug",
          "open": 1,
          "showContext": false
        },
        {
          "type": "switch",
          "eval": "data",
          "cases": [
            {
              "value": "",
              "blocks": []
            },
            {
              "value": null,
              "blocks": []
            }
          ],
          "default": {
            "blocks": [
              {
                "type": "variable-set",
                "name": "bloomenAuth",
                "firstChange": true
              }
            ]
          }
        }
      ],
      "id": "login",
      "adapterName": "bloomen"
    },
    "configs/messageExample.json": {
      "title": "Message block example",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "query",
          "dataSource": {
            "type": "remote",
            "endpoint": "https://fake-api.now32.now.sh/soundRecording"
          }
        },
        {
          "type": "mapping",
          "mapping": "result[0]"
        },
        {
          "type": "message",
          "title": "{{title}}",
          "message": "by {{mainArtist}} ({{yearOfRecording}})"
        }
      ]
    },
    "configs/photo-search-example.json": {
      "title": "Photo search (Bloomen API)",
      "blocks": [
        {
          "type": "form",
          "hasSubmit": false,
          "jsonSchema": {
            "properties": {
              "term": {
                "title": "Search",
                "type": "string"
              }
            }
          },
          "uiSchema": {}
        },
        {
          "type": "context",
          "contextPath": "bloomenAuth",
          "contextBlocks": [
            {
              "type": "variable-get",
              "name": "bloomenAuth"
            }
          ],
          "blocks": [
            {
              "type": "http",
              "method": "post",
              "notify": false,
              "endpoint": {
                "protocol": "https:",
                "host": "bloomen.herokuapp.com",
                "pathname": "/photos/search"
              },
              "authentication": {
                "type": "bearer",
                "valueGetters": {
                  "jwt": "context.bloomenAuth"
                }
              }
            }
          ]
        },
        {
          "type": "batch",
          "flex": true,
          "blocks": [
            {
              "type": "card",
              "blocks": [
                {
                  "type": "template",
                  "template": "<p>{{description}}</p><img width=\"200\" src=\"{{url}}\">"
                },
                {
                  "type": "debug",
                  "showContext": false,
                  "open": 0
                }
              ]
            }
          ]
        }
      ]
    },
    "configs/register.json": {
      "title": "Register",
      "blocks": [
        {
          "type": "form",
          "adapter": "bloomen",
          "formId": "user"
        }
      ]
    },
    "configs/search.json": {
      "title": "Search",
      "blocks": [
        {
          "type": "form",
          "label": "Search",
          "jsonSchema": {
            "properties": {
              "term": {
                "title": "Search",
                "type": "string"
              }
            }
          },
          "uiSchema": {}
        },
        {
          "type": "context",
          "contextPath": "bloomenAuth",
          "contextBlocks": [
            {
              "type": "variable-get",
              "name": "bloomenAuth"
            }
          ],
          "blocks": [
            {
              "type": "http",
              "method": "post",
              "notify": false,
              "endpoint": {
                "protocol": "https:",
                "host": "bloomen.herokuapp.com",
                "pathname": "/photos/search"
              },
              "authentication": {
                "type": "bearer",
                "valueGetters": {
                  "jwt": "context.bloomenAuth"
                }
              }
            }
          ]
        },
        {
          "type": "batch",
          "flex": true,
          "blocks": [
            {
              "type": "card",
              "blocks": [
                {
                  "type": "template",
                  "template": "<p>{{data.description}}</p><img width=\"200\" src=\"{{data.url}}\">"
                },
                {
                  "type": "debug",
                  "showContext": false,
                  "open": 0
                }
              ]
            }
          ]
        }
      ],
      "id": "search",
      "adapterName": "bloomen"
    },
    "configs/selectOrganisation.json": {
      "title": "Select organisation",
      "blocks": [
        {
          "type": "mapping",
          "mapping": "['digit', 'test', 'another']"
        },
        {
          "type": "mapping",
          "mapping": "data[].{ value: @, label: @ }"
        },
        {
          "type": "reference",
          "fieldLabel": "Organisation",
          "valueField": "value"
        }
      ],
      "id": "selectOrganisation",
      "adapterName": "bloomen"
    },
    "configs/templateExample.json": {
      "title": "Query and template example",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "query",
          "dataSource": {
            "type": "remote",
            "endpoint": "https://fake-api.now32.now.sh/musicalWork"
          }
        },
        {
          "type": "mapping",
          "mapping": "result[0]"
        },
        {
          "type": "template",
          "template": "<h1>{{originalTitle}}</h1><p>This musical work has ISWC {{ISWC}} and {{associatedISRCs.length}} related recordings.</p><p>Performers:</p><ul>{{#each associatedPerformers}}<li>{{this}}</li>{{/each}}</ul><p>Associated ISRCs:</p><ul>{{#each associatedISRCs}}<li>{{this}}</li>{{/each}}</ul>"
        }
      ]
    },
    "configs/users.json": {
      "title": "Users",
      "blocks": [
        {
          "type": "multi",
          "batches": [
            {
              "blocks": [
                {
                  "type": "actions",
                  "buttons": [
                    {
                      "label": "Create User",
                      "blocks": [
                        {
                          "type": "launch",
                          "adapter": "bloomen",
                          "workflowId": "register"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "message",
                  "title": "Users (Bloomen API)"
                },
                {
                  "type": "init"
                },
                {
                  "type": "variable-get",
                  "name": "bloomenAuth"
                },
                {
                  "type": "context-save",
                  "contextKey": "bloomenAuth"
                },
                {
                  "type": "http",
                  "method": "get",
                  "endpoint": {
                    "protocol": "https:",
                    "host": "bloomen.herokuapp.com",
                    "pathname": "/users/all"
                  },
                  "authentication": {
                    "type": "bearer",
                    "valueGetters": {
                      "jwt": "context.bloomenAuth"
                    }
                  }
                },
                {
                  "type": "grid",
                  "gridOptions": {
                    "pagination": true,
                    "paginationPageSize": 10,
                    "rowSelection": "multiple"
                  },
                  "columnDefs": [
                    {
                      "width": 50,
                      "resizable": false,
                      "checkboxSelection": true
                    },
                    {
                      "headerName": "ID",
                      "field": "id"
                    },
                    {
                      "headerName": "Username",
                      "field": "username"
                    },
                    {
                      "headerName": "Roles",
                      "field": "role"
                    },
                    {
                      "headerName": "First name",
                      "field": "kyc.firstname"
                    },
                    {
                      "headerName": "Last name",
                      "field": "kyc.lastname"
                    },
                    {
                      "headerName": "Operations",
                      "cellRenderer": "workflowRenderer",
                      "cellRendererParams": {
                        "blocks": [
                          {
                            "type": "actions",
                            "buttons": [
                              {
                                "label": "View",
                                "blocks": [
                                  {
                                    "type": "dialog",
                                    "blocks": [
                                      {
                                        "type": "debug"
                                      },
                                      {
                                        "type": "actions",
                                        "buttons": [
                                          {
                                            "label": "OK",
                                            "blocks": [
                                              {
                                                "type": "init"
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              },
                              {
                                "label": "Edit",
                                "blocks": [
                                  {
                                    "type": "launch",
                                    "adapter": "bloomen",
                                    "workflowId": "editUser",
                                    "context": {
                                      "id": "data.id",
                                      "hash": "data.hash"
                                    }
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "id": "users",
      "adapterName": "bloomen"
    },
    "configs/viewWork.json": {
      "title": "View Musical Work",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "notify": false,
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "valueGetters": {
              "pathname": "join('', ['/sound/music/', context.queryParams.id])"
            }
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "debug",
          "open": 2
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Cancel",
              "blocks": [
                {
                  "type": "launch",
                  "adapter": "bloomen",
                  "workflowId": "listWorks"
                }
              ]
            }
          ]
        }
      ],
      "id": "viewWork",
      "adapterName": "bloomen"
    },
    "configs/workVersions.json": {
      "title": "Musical Work (Versions)",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "variable-get",
          "name": "bloomenAuth"
        },
        {
          "type": "context-save",
          "contextKey": "bloomenAuth"
        },
        {
          "type": "http",
          "method": "get",
          "notify": false,
          "endpoint": {
            "protocol": "https:",
            "host": "bloomen.herokuapp.com",
            "valueGetters": {
              "pathname": "join('', ['/sound/music/', context.queryParams.id])"
            }
          },
          "authentication": {
            "type": "bearer",
            "valueGetters": {
              "jwt": "context.bloomenAuth"
            }
          }
        },
        {
          "type": "debug",
          "open": 0
        },
        {
          "type": "mapping",
          "mapping": "data.versions || []"
        },
        {
          "type": "grid",
          "gridOptions": {},
          "columnDefs": [
            {
              "headerName": "Title",
              "field": "value.originalTitle"
            },
            {
              "headerName": "ISWC",
              "field": "value.ISWC"
            },
            {
              "headerName": "Modified at",
              "field": "modifiedAtUTC"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "mapping",
                                "mapping": "data.value.omit(@, ['_id', '__v', 'versions'])"
                              },
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Revert",
                        "blocks": [
                          {
                            "type": "mapping",
                            "mapping": "data.value.omit(@, ['_id', '__v', 'versions'])"
                          },
                          {
                            "type": "http",
                            "method": "put",
                            "notify": true,
                            "firstChange": true,
                            "skipInit": true,
                            "endpoint": {
                              "protocol": "https:",
                              "host": "bloomen.herokuapp.com",
                              "valueGetters": {
                                "pathname": "join('', ['/sound/music/', context.queryParams.id])"
                              }
                            },
                            "authentication": {
                              "type": "bearer",
                              "valueGetters": {
                                "jwt": "context.bloomenAuth"
                              }
                            }
                          },
                          {
                            "type": "launch",
                            "adapter": "bloomen",
                            "workflowId": "listWorks"
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Cancel",
              "blocks": [
                {
                  "type": "launch",
                  "adapter": "bloomen",
                  "workflowId": "listWorks"
                }
              ]
            }
          ]
        }
      ],
      "id": "workVersions",
      "adapterName": "bloomen"
    },
    "forms/musicalWork.ui.json": {
      "rights": {
        "items": {
          "startDate": {
            "ui:widget": "datepicker"
          },
          "endDate": {
            "ui:widget": "datepicker"
          }
        }
      }
    },
    "forms/photo.ui.json": {
      "url": {
        "ui:widget": "remote-image"
      }
    },
    "forms/soundRecording.ui.json": {},
    "forms/user.ui.json": {},
    "schemas/musicalWork.schema.json": {
      "title": "Bloomen MusicalWork",
      "description": "Representation of a MusicalWork for the Bloomen Project",
      "type": "object",
      "properties": {
        "ISWC": {
          "title": "ISWC",
          "$ref": "#/definitions/ISWC"
        },
        "originalTitle": {
          "title": "originalTitle",
          "type": "string"
        },
        "group": {
          "title": "group",
          "type": "string"
        },
        "creators": {
          "title": "creators",
          "type": "array",
          "items": {
            "$ref": "#/definitions/creator"
          }
        },
        "alternativeTitles": {
          "type": "array",
          "title": "Alternative titles",
          "items": {
            "type": "string"
          }
        },
        "associatedPerformers": {
          "type": "array",
          "title": "Associated performers",
          "items": {
            "type": "string"
          }
        },
        "associatedISRCs": {
          "type": "array",
          "title": "Associated ISRCs",
          "items": {
            "$ref": "#/definitions/ISRC"
          }
        },
        "rights": {
          "type": "array",
          "title": "Rights",
          "items": {
            "$ref": "#/definitions/right"
          }
        }
      },
      "definitions": {
        "IPINameNumber": {
          "type": "string",
          "pattern": "^[0-9]{11}$"
        },
        "ISWC": {
          "type": "string",
          "pattern": "^T-?[0-9]{3}\\.?[0-9]{3}\\.?[0-9]{3}-?[0-9]$"
        },
        "ISRC": {
          "type": "string",
          "pattern": "^[A-Z0-9]{2}-?[A-Z0-9]{3}-?[0-9]{2}-?[0-9]{5}$"
        },
        "creator": {
          "type": "object",
          "properties": {
            "name": {
              "title": "Name",
              "type": "string"
            },
            "IPINameNumber": {
              "title": "IPI Name Number",
              "$ref": "#/definitions/IPINameNumber"
            },
            "role": {
              "type": "string",
              "title": "Role",
              "$ref": "#/definitions/creatorsRole"
            }
          }
        },
        "creatorsRole": {
          "type": "string",
          "enum": [
            "Adapter",
            "Arranger",
            "Lyricist",
            "Composer",
            "ComposerLyricist",
            "SubArranger",
            "SubAuthor",
            "Translator",
            "IncomeParticipant"
          ]
        },
        "right": {
          "type": "object",
          "properties": {
            "rightsHolder": {
              "title": "Rights holder",
              "$ref": "#/definitions/rightsholder"
            },
            "rightsHolderOriginalPublisher": {
              "title": "Rights holder original publisher",
              "type": "object",
              "properties": {
                "name": {
                  "title": "Name",
                  "type": "string"
                },
                "IPINameNumber": {
                  "title": "IPI Name Number",
                  "$ref": "#/definitions/IPINameNumber"
                }
              }
            },
            "rightsHolderProprietaryId": {
              "title": "Name",
              "type": "string"
            },
            "territories": {
              "title": "Territories",
              "type": "array",
              "items": {
                "$ref": "#/definitions/rightsTerritories"
              }
            },
            "startDate": {
              "title": "Start date",
              "type": "string",
              "format": "date"
            },
            "endDate": {
              "title": "End date",
              "type": "string",
              "format": "date"
            },
            "mechanical": {
              "title": "Mechanical",
              "$ref": "#/definitions/split"
            },
            "performance": {
              "title": "Performance",
              "$ref": "#/definitions/split"
            },
            "synchronisation": {
              "title": "Synchronisation",
              "$ref": "#/definitions/split"
            }
          }
        },
        "split": {
          "type": "object",
          "properties": {
            "affiliationSociety": {
              "title": "Affiliation society",
              "$ref": "#/definitions/affiliationSociety"
            },
            "ownershipSplit": {
              "title": "Ownership split",
              "type": "number",
              "minimum": 0,
              "maximum": 100
            },
            "collectionSplit": {
              "title": "Collection split",
              "type": "number",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "rightsholder": {
          "type": "object",
          "properties": {
            "name": {
              "title": "Name",
              "type": "string"
            },
            "IPINameNumber": {
              "title": "IPI Name Number",
              "$ref": "#/definitions/IPINameNumber"
            },
            "role": {
              "type": "string",
              "title": "Role",
              "$ref": "#/definitions/creatorsRole"
            }
          }
        },
        "rightsholderRole": {
          "type": "string",
          "enum": [
            "Writer",
            "OriginalPublisher",
            "SubPublisher",
            "RoyaltyAdministrator"
          ]
        },
        "rightsTerritories": {
          "type": "string",
          "enum": [
            "AF",
            "AL",
            "DZ",
            "AS",
            "AD",
            "AO",
            "AI",
            "AQ",
            "AG",
            "AR",
            "AM",
            "AW",
            "AU",
            "AT",
            "AZ",
            "BS",
            "BH",
            "BD",
            "BB",
            "BY",
            "BE",
            "BZ",
            "BJ",
            "BM",
            "BT",
            "BO",
            "BQ",
            "BA",
            "BW",
            "BV",
            "BR",
            "IO",
            "BN",
            "BG",
            "BF",
            "BI",
            "CV",
            "KH",
            "CM",
            "CA",
            "KY",
            "CF",
            "TD",
            "CL",
            "CN",
            "CX",
            "CC",
            "CO",
            "KM",
            "CD",
            "CG",
            "CK",
            "CR",
            "HR",
            "CU",
            "CW",
            "CY",
            "CZ",
            "CI",
            "DK",
            "DJ",
            "DM",
            "DO",
            "EC",
            "EG",
            "SV",
            "GQ",
            "ER",
            "EE",
            "SZ",
            "ET",
            "FK",
            "FO",
            "FJ",
            "FI",
            "FR",
            "GF",
            "PF",
            "TF",
            "GA",
            "GM",
            "GE",
            "DE",
            "GH",
            "GI",
            "GR",
            "GL",
            "GD",
            "GP",
            "GU",
            "GT",
            "GG",
            "GN",
            "GW",
            "GY",
            "HT",
            "HM",
            "VA",
            "HN",
            "HK",
            "HU",
            "IS",
            "IN",
            "ID",
            "IR",
            "IQ",
            "IE",
            "IM",
            "IL",
            "IT",
            "JM",
            "JP",
            "JE",
            "JO",
            "KZ",
            "KE",
            "KI",
            "KP",
            "KR",
            "KW",
            "KG",
            "LA",
            "LV",
            "LB",
            "LS",
            "LR",
            "LY",
            "LI",
            "LT",
            "LU",
            "MO",
            "MG",
            "MW",
            "MY",
            "MV",
            "ML",
            "MT",
            "MH",
            "MQ",
            "MR",
            "MU",
            "YT",
            "MX",
            "FM",
            "MD",
            "MC",
            "MN",
            "ME",
            "MS",
            "MA",
            "MZ",
            "MM",
            "NA",
            "NR",
            "NP",
            "NL",
            "NC",
            "NZ",
            "NI",
            "NE",
            "NG",
            "NU",
            "NF",
            "MP",
            "NO",
            "OM",
            "PK",
            "PW",
            "PS",
            "PA",
            "PG",
            "PY",
            "PE",
            "PH",
            "PN",
            "PL",
            "PT",
            "PR",
            "QA",
            "MK",
            "RO",
            "RU",
            "RW",
            "RE",
            "BL",
            "SH",
            "KN",
            "LC",
            "MF",
            "PM",
            "VC",
            "WS",
            "SM",
            "ST",
            "SA",
            "SN",
            "RS",
            "SC",
            "SL",
            "SG",
            "SX",
            "SK",
            "SI",
            "SB",
            "SO",
            "ZA",
            "GS",
            "SS",
            "ES",
            "LK",
            "SD",
            "SR",
            "SJ",
            "SE",
            "CH",
            "SY",
            "TW",
            "TJ",
            "TZ",
            "TH",
            "TL",
            "TG",
            "TK",
            "TO",
            "TT",
            "TN",
            "TR",
            "TM",
            "TC",
            "TV",
            "UG",
            "UA",
            "AE",
            "GB",
            "UM",
            "US",
            "UY",
            "UZ",
            "VU",
            "VE",
            "VN",
            "VG",
            "VI",
            "WF",
            "EH",
            "YE",
            "ZM",
            "ZW",
            "AX"
          ]
        },
        "affiliationSociety": {
          "type": "string",
          "enum": [
            "ACUM",
            "ADDAF",
            "AEPI",
            "AGADU",
            "AKM",
            "BUCUDA",
            "APDAYC",
            "APRA",
            "ARTISJUS",
            "ASCAP",
            "AUSTRO-MECHANA",
            "AMCOS",
            "AWA",
            "ARGENTORES",
            "APA",
            "BUMDA",
            "AMRA",
            "BGDA",
            "BMDA",
            "SODRAC",
            "BMI",
            "MCSN",
            "BUMA",
            "BURIDA",
            "BSDA",
            "CASH",
            "CAPAC",
            "LITA",
            "SCD",
            "AMAR",
            "DILIA",
            "FILSCAP",
            "OMDA",
            "HARRY FOX AGENCY",
            "GEMA",
            "IPRS",
            "BUBEDRA",
            "JASRAC",
            "MUSICAUTOR",
            "KODA",
            "LITERAR-MECHANA",
            "LVG",
            "MCSK",
            "MCPS",
            "BBDA",
            "MRS",
            "BCDA",
            "NCB",
            "ONDA",
            "OSA",
            "PROLITTERIS",
            "PRS",
            "PROCAN",
            "ALCS",
            "SABAM",
            "SACD",
            "SACERAU",
            "SACEM",
            "SACM",
            "SACVEN",
            "SADAIC",
            "SADEMBRA",
            "SAMRO",
            "SOKOJ",
            "SAYCE",
            "SBACEM",
            "SBAT",
            "SPA",
            "SOGEM",
            "SESAC",
            "SGAE",
            "SCAM",
            "SIAE",
            "SUISSIMAGE",
            "ACEMLA",
            "STEF",
            "STEMRA",
            "STIM",
            "SUISA",
            "SARRAL",
            "OTPDA",
            "SONECA",
            "SAYCO",
            "SOZA",
            "SICAM",
            "SPACEMF",
            "CMRRA",
            "TEOSTO",
            "TONO",
            "SSA",
            "SOCINADA",
            "UBC",
            "RAO",
            "VG WORT",
            "COTT",
            "ZAIKS",
            "ZIMRA",
            "NS",
            "SOCAN",
            "NASCAM",
            "ACDAM",
            "MACP",
            "MASA",
            "COMPASS",
            "ACAM",
            "CHA",
            "KCI",
            "LATGA-A",
            "HDS-ZAMP",
            "SAZAS",
            "LAA",
            "AGAYC",
            "UCMR-ADA",
            "EAU",
            "MESAM",
            "KOMCA",
            "MCSC",
            "LIRA",
            "VDFS",
            "AKKA/LAA",
            "COSGA",
            "COSOMA",
            "BNDA",
            "MCT",
            "ALBAUTOR",
            "IMRO",
            "SOBODAYCOM",
            "BUTODRA",
            "SADA",
            "BILD-KUNST",
            "ZAMCOPS",
            "SLPRS",
            "SADH",
            "ZAMP",
            "SOFAM",
            "KOPIOSTO",
            "COPY-DAN BILLEDKUNST",
            "UACRR",
            "ATN",
            "DALRO",
            "TEATERAUTOR",
            "HAA",
            "DPRS",
            "SPAC",
            "FILMAUTOR",
            "ADAGP",
            "ARS",
            "BEELDRECHT",
            "BONO",
            "BUS",
            "DACS",
            "HUNGART",
            "SOMAAP",
            "VAGA",
            "VBK",
            "VEGAP",
            "VISCOPY",
            "RUPIS",
            "MUST",
            "AMPAL",
            "APG-JAPAN",
            "APSAV",
            "AUTORARTE",
            "BURAFO",
            "CAL",
            "COSCAP",
            "CPSN",
            "CREAIMAGEN",
            "DGA",
            "DIRECTORES",
            "FLIM JUS",
            "COPYRO",
            "JACAP",
            "KAZAK",
            "KOSA",
            "KUVASTO",
            "MUSIKEDITION",
            "NMPA",
            "PAPPRI",
            "SACK",
            "SARTEC",
            "SESAM",
            "SGDL",
            "SNAC",
            "SOCIETE DE L’IMAGE",
            "SOCINPRO",
            "SOPE",
            "SPACQ",
            "SFF",
            "THE SOCIETY OF AUTHORS",
            "UFFICIO LEGALE",
            "VEVAM",
            "WGA",
            "WGJ",
            "ZAPA",
            "MSG",
            "ABRAMUS",
            "ASDAC",
            "AWGACS",
            "SAS",
            "SODART",
            "SUOMEN KIRJAILIJALIITTO",
            "THE AUTHOR'S REGISTRY INC.",
            "SGA",
            "ARMAUTHOR",
            "ACCESS",
            "CSCS",
            "DRCC",
            "HMS",
            "KYRGYZPATENT",
            "SQN",
            "ABRAC",
            "ANACIM",
            "ASSIM",
            "ATIDA",
            "SABEM",
            "FONOPERU",
            "COSOTA",
            "SOMAS",
            "SAIF",
            "AACIMH",
            "SGACEDOM",
            "ROMS",
            "ICG",
            "ADAVIS",
            "AUTVIS",
            "GESTOR",
            "SACEMLUXEMBOURG",
            "UCOSO",
            "SACENC",
            "WID CENTRE",
            "GESAC",
            "LATINAUTOR",
            "NORD-DOC",
            "SONGCODE",
            "IMJV",
            "CCL",
            "MISASIA",
            "ECAD",
            "LATINNET",
            "DIVA"
          ]
        }
      }
    },
    "schemas/photo.schema.json": {
      "title": "Bloomen Photo",
      "description": "Photo metadata from the Bloomen project",
      "type": "object",
      "version": 0,
      "name": "bloomen_Photo",
      "properties": {
        "description": {
          "title": "Description",
          "type": "string"
        },
        "price": {
          "title": "Price",
          "type": "number"
        },
        "attribution": {
          "title": "Attribution",
          "type": "boolean"
        },
        "keywords": {
          "title": "Keywords",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "url": {
          "title": "URL",
          "type": "string",
          "format": "uri"
        },
        "rightsRegion": {
          "title": "Rights region",
          "format": "string"
        },
        "ownerUser": {
          "title": "Owner (User)",
          "type": "object",
          "properties": {
            "id": {
              "title": "User ID",
              "type": "string"
            },
            "username": {
              "title": "Username",
              "type": "string"
            }
          }
        },
        "owner": {
          "title": "Owner",
          "type": "string"
        },
        "geo": {
          "title": "Geolocation",
          "type": "object",
          "properties": {
            "lat": {
              "title": "lat",
              "type": "string"
            },
            "long": {
              "title": "long",
              "type": "string"
            }
          }
        },
        "createdAtUTC": {
          "title": "Created at",
          "type": "string",
          "format": "datetime"
        },
        "rightsTime": {
          "title": "Rights time",
          "type": "string",
          "format": "datetime"
        },
        "type": {
          "title": "Type",
          "type": "string",
          "enum": [
            "photo"
          ]
        }
      }
    },
    "schemas/soundRecording.schema.json": {
      "title": "Bloomen SoundRecording",
      "description": "Representation of a SoundRecording for the Bloomen Project",
      "type": "object",
      "properties": {
        "ISRC": {
          "title": "ISRC",
          "$ref": "#/definitions/ISRC"
        },
        "mainArtist": {
          "title": "Main artist",
          "type": "string"
        },
        "group": {
          "title": "group",
          "type": "string"
        },
        "featuredArtists": {
          "title": "Featured artists",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "versionTitle": {
          "title": "Version title",
          "type": "string"
        },
        "duration": {
          "title": "Duration",
          "type": "integer"
        },
        "yearOfRecording": {
          "title": "Year of recording",
          "type": "integer"
        },
        "territoryOfRecording": {
          "title": "Territory of recording",
          "$ref": "#/definitions/territory"
        },
        "languageOfPerformance": {
          "title": "Language of performance",
          "$ref": "#/definitions/languageOfPerformance"
        },
        "originalReleaseDate": {
          "title": "Original release date",
          "type": "string",
          "format": "date"
        },
        "originalReleaseLabel": {
          "title": "Original release label",
          "type": "string"
        },
        "creators": {
          "title": "Creators",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "isVideo": {
          "title": "Is video?",
          "type": "boolean"
        },
        "releases": {
          "title": "Releases",
          "type": "array",
          "items": {
            "$ref": "#/definitions/release"
          }
        },
        "rights": {
          "title": "Rights",
          "type": "array",
          "items": {
            "$ref": "#/definitions/right"
          }
        }
      },
      "definitions": {
        "release": {
          "type": "object",
          "properties": {
            "title": {
              "title": "Title",
              "type": "string"
            },
            "artist": {
              "title": "Artist",
              "type": "string"
            },
            "ICPN": {
              "title": "ICPN",
              "type": "string",
              "pattern": "^[0-9]{0,13}$"
            },
            "numberOfTracks": {
              "title": "Number of tracks",
              "type": "integer"
            },
            "label": {
              "title": "Label",
              "type": "string"
            },
            "duration": {
              "title": "Duration",
              "type": "integer"
            },
            "isCompilation": {
              "title": "Is compilation?",
              "type": "boolean"
            }
          }
        },
        "right": {
          "type": "object",
          "properties": {
            "rightsHolder": {
              "title": "Rightsholder",
              "type": "string"
            },
            "rightsHolderProprietaryId": {
              "title": "Rightsholder proprietary ID",
              "type": "string"
            },
            "rightsOwner": {
              "title": "Rights owner",
              "type": "string"
            },
            "rightsOwnerProprietaryId": {
              "title": "Rights owner proprietary ID",
              "type": "string"
            },
            "territories": {
              "title": "Territories",
              "type": "array",
              "items": {
                "$ref": "#/definitions/territory"
              }
            },
            "startDate": {
              "title": "Start date",
              "type": "string",
              "format": "date"
            },
            "endDate": {
              "title": "End date",
              "type": "string",
              "format": "date"
            },
            "split": {
              "title": "Split",
              "type": "number",
              "minimum": 0,
              "maximum": 100
            },
            "useTypes": {
              "title": "Use types",
              "type": "array",
              "items": {
                "$ref": "#/definitions/useTypes"
              }
            }
          }
        },
        "ISRC": {
          "type": "string",
          "pattern": "^[A-Z0-9]{2}-?[A-Z0-9]{3}-?[0-9]{2}-?[0-9]{5}$"
        },
        "useTypes": {
          "type": "string",
          "enum": [
            "PublicPerformance",
            "Airlines",
            "RadioBroadcasting",
            "RadioDubbing",
            "TVBroadcasting",
            "TVDubbing",
            "BackgroundMusic",
            "BackgroundMusicDubbing",
            "KaraokePublicPerformance",
            "KaraokeDubbing",
            "KaraokeOnDemand",
            "KaraokeOnDemandDubbing",
            "CableRetransmission",
            "RadioSimulcast",
            "Webcast",
            "TVSimulcast",
            "CatchUpTV",
            "PrivateCopying",
            "RingbackTones"
          ]
        },
        "territory": {
          "type": "string",
          "enum": [
            "AF",
            "AL",
            "DZ",
            "AS",
            "AD",
            "AO",
            "AI",
            "AQ",
            "AG",
            "AR",
            "AM",
            "AW",
            "AU",
            "AT",
            "AZ",
            "BS",
            "BH",
            "BD",
            "BB",
            "BY",
            "BE",
            "BZ",
            "BJ",
            "BM",
            "BT",
            "BO",
            "BQ",
            "BA",
            "BW",
            "BV",
            "BR",
            "IO",
            "BN",
            "BG",
            "BF",
            "BI",
            "CV",
            "KH",
            "CM",
            "CA",
            "KY",
            "CF",
            "TD",
            "CL",
            "CN",
            "CX",
            "CC",
            "CO",
            "KM",
            "CD",
            "CG",
            "CK",
            "CR",
            "HR",
            "CU",
            "CW",
            "CY",
            "CZ",
            "CI",
            "DK",
            "DJ",
            "DM",
            "DO",
            "EC",
            "EG",
            "SV",
            "GQ",
            "ER",
            "EE",
            "SZ",
            "ET",
            "FK",
            "FO",
            "FJ",
            "FI",
            "FR",
            "GF",
            "PF",
            "TF",
            "GA",
            "GM",
            "GE",
            "DE",
            "GH",
            "GI",
            "GR",
            "GL",
            "GD",
            "GP",
            "GU",
            "GT",
            "GG",
            "GN",
            "GW",
            "GY",
            "HT",
            "HM",
            "VA",
            "HN",
            "HK",
            "HU",
            "IS",
            "IN",
            "ID",
            "IR",
            "IQ",
            "IE",
            "IM",
            "IL",
            "IT",
            "JM",
            "JP",
            "JE",
            "JO",
            "KZ",
            "KE",
            "KI",
            "KP",
            "KR",
            "KW",
            "KG",
            "LA",
            "LV",
            "LB",
            "LS",
            "LR",
            "LY",
            "LI",
            "LT",
            "LU",
            "MO",
            "MG",
            "MW",
            "MY",
            "MV",
            "ML",
            "MT",
            "MH",
            "MQ",
            "MR",
            "MU",
            "YT",
            "MX",
            "FM",
            "MD",
            "MC",
            "MN",
            "ME",
            "MS",
            "MA",
            "MZ",
            "MM",
            "NA",
            "NR",
            "NP",
            "NL",
            "NC",
            "NZ",
            "NI",
            "NE",
            "NG",
            "NU",
            "NF",
            "MP",
            "NO",
            "OM",
            "PK",
            "PW",
            "PS",
            "PA",
            "PG",
            "PY",
            "PE",
            "PH",
            "PN",
            "PL",
            "PT",
            "PR",
            "QA",
            "MK",
            "RO",
            "RU",
            "RW",
            "RE",
            "BL",
            "SH",
            "KN",
            "LC",
            "MF",
            "PM",
            "VC",
            "WS",
            "SM",
            "ST",
            "SA",
            "SN",
            "RS",
            "SC",
            "SL",
            "SG",
            "SX",
            "SK",
            "SI",
            "SB",
            "SO",
            "ZA",
            "GS",
            "SS",
            "ES",
            "LK",
            "SD",
            "SR",
            "SJ",
            "SE",
            "CH",
            "SY",
            "TW",
            "TJ",
            "TZ",
            "TH",
            "TL",
            "TG",
            "TK",
            "TO",
            "TT",
            "TN",
            "TR",
            "TM",
            "TC",
            "TV",
            "UG",
            "UA",
            "AE",
            "GB",
            "UM",
            "US",
            "UY",
            "UZ",
            "VU",
            "VE",
            "VN",
            "VG",
            "VI",
            "WF",
            "EH",
            "YE",
            "ZM",
            "ZW",
            "AX"
          ]
        },
        "languageOfPerformance": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "alpha-3/ISO 639-2 codes"
        }
      }
    },
    "schemas/user.schema.json": {
      "title": "Bloomen User",
      "description": "User metadata from the Bloomen project",
      "type": "object",
      "version": 0,
      "name": "bloomen_User",
      "properties": {
        "username": {
          "title": "Username",
          "type": "string"
        },
        "organisation": {
          "title": "Organisation",
          "type": "string"
        },
        "createdATUTC": {
          "title": "Created at",
          "type": "string",
          "format": "datetime"
        },
        "email": {
          "title": "Email",
          "type": "string",
          "format": "email"
        },
        "id": {
          "title": "Bloomen ID",
          "type": "string"
        },
        "hash": {
          "title": "Hash ID",
          "type": "string"
        },
        "role": {
          "title": "Role",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "photographer",
              "publisher",
              "admin"
            ]
          }
        },
        "reputation": {
          "title": "Reputation",
          "type": "object",
          "properties": {
            "positive": {
              "title": "Positive",
              "type": "integer"
            },
            "negative": {
              "title": "Negative",
              "type": "integer"
            }
          }
        },
        "kyc": {
          "title": "KYC",
          "type": "object",
          "properties": {
            "address": {
              "title": "Address",
              "type": "string"
            },
            "phone": {
              "title": "Address",
              "type": "string"
            },
            "firstname": {
              "title": "Address",
              "type": "string"
            },
            "lastname": {
              "title": "Address",
              "type": "string"
            },
            "id1": {
              "title": "id1",
              "type": "string",
              "format": "uri"
            },
            "id2": {
              "title": "id2",
              "type": "string",
              "format": "uri"
            },
            "status": {
              "title": "Status",
              "type": "integer"
            },
            "reviewdBy": {
              "title": "Reviewed by",
              "type": "string"
            }
          }
        }
      }
    },
    "swagger/api-docs.json": {
      "info": {
        "description": "The Bloomen Platform documentation",
        "title": "Bloomen Platform",
        "version": "0.4.0"
      },
      "host": "bloomen.herokuapp.com",
      "basePath": "/",
      "produces": [
        "application/json"
      ],
      "schemes": [
        "https"
      ],
      "securityDefinitions": {
        "JWT": {
          "type": "apiKey",
          "in": "header",
          "name": "Authorization",
          "description": "Publisher:\nBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InJvbGUiOiJwdWJsaXNoZXIiLCJyZXB1dGF0aW9uIjp7InBvc2l0aXZlIjowLCJuZWdhdGl2ZSI6MH0sInNldHRpbmdzIjp7ImF0dHJpYnV0aW9uIjp0cnVlfSwia3ljIjp7ImFkZHJlc3MiOiIiLCJwaG9uZSI6IiIsImZpcnN0bmFtZSI6IiIsImxhc3RuYW1lIjoiIiwiaWQxIjoiIiwiaWQyIjoiIiwic3RhdHVzIjowLCJyZXZpZXdlZEJ5IjoiIn0sIl9pZCI6IjViYjQ5MDI5NGRkN2ExMmNhYzQxYTU3NSIsInVzZXJuYW1lIjoicHVibGlzaGVyIiwiaGFzaCI6IjUyYWRlZDE2NTM2MDM1MmEwZjU4NTc1NzFkOTZkNjhmIiwiZW1haWwiOiJwdWJsaXNoZXJAYXRjLmdyIiwib3JnYW5pc2F0aW9uIjoiQVRDIiwiY3JlYXRlZEF0VVRDIjoiMjAxOC0xMC0wM1QwOTo0NzoyMS4zMDlaIiwiX192IjowLCJvcmciOm51bGwsImlkIjoiNWJiNDkwMjk0ZGQ3YTEyY2FjNDFhNTc1In0sImlhdCI6MTU1MDU4MTk0Nn0.jxCWK2avRtvmuh0rdeg8z0iu1sG4JaBfkI_gZDNx1Co\nPhotographer:\nBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InJvbGUiOiJwaG90b2dyYXBoZXIiLCJyZXB1dGF0aW9uIjp7InBvc2l0aXZlIjo3LCJuZWdhdGl2ZSI6MH0sInNldHRpbmdzIjp7ImF0dHJpYnV0aW9uIjp0cnVlfSwia3ljIjp7ImFkZHJlc3MiOiIiLCJwaG9uZSI6IiIsImZpcnN0bmFtZSI6IiIsImxhc3RuYW1lIjoiIiwiaWQxIjoiIiwiaWQyIjoiIiwic3RhdHVzIjowLCJyZXZpZXdlZEJ5IjoiIn0sIl9pZCI6IjViYjM1ZmE2ZWIwNDMxMWE1YzYwNjA0MCIsInVzZXJuYW1lIjoicGhvdG9ncmFwaGVyIiwiaGFzaCI6ImFiNWIwMzgxN2NhYTAxYzRhMmEwZWFkY2ZlNjQ4NjljIiwiZW1haWwiOiJwaG90b2dyYXBoZXJAdGVzdC5jb20iLCJvcmdhbmlzYXRpb24iOiJwaG90b2dyYXBoZXIiLCJjcmVhdGVkQXRVVEMiOiIyMDE4LTEwLTAyVDEyOjA4OjA2LjEyMloiLCJfX3YiOjB9LCJpYXQiOjE1NTA1MDM2NTR9.LThaEsPkrDkvlvKMw276PHlEsl430yNDAPATFi9sNw8"
        }
      },
      "security": {
        "JWT": []
      },
      "swagger": "2.0",
      "paths": {
        "/auth/login": {
          "post": {
            "parameters": [
              {
                "name": "credentials",
                "in": "body",
                "description": "Login info",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/LoginDTO"
                }
              }
            ],
            "description": "User login, returns JWT token.",
            "tags": [
              "authentication"
            ],
            "responses": {
              "200": {
                "description": "JWT token",
                "schema": {
                  "$ref": "#/definitions/JwtDTO"
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            }
          }
        },
        "/auth/register": {
          "post": {
            "parameters": [
              {
                "name": "data",
                "in": "body",
                "description": "Register info",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/RegisterDTO"
                }
              }
            ],
            "description": "User registration, returns JWT token.",
            "tags": [
              "authentication"
            ],
            "responses": {
              "200": {
                "description": "JWT token",
                "schema": {
                  "$ref": "#/definitions/JwtDTO"
                }
              },
              "400": {
                "description": "Invalid Invitation"
              },
              "500": {
                "description": "Unexpected"
              }
            }
          }
        },
        "/auth/forgot": {
          "post": {
            "parameters": [
              {
                "name": "body",
                "in": "body",
                "description": "User email",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/ForgotDTO"
                }
              }
            ],
            "description": "Forgot password, resets password and sends email to user to reset it.",
            "tags": [
              "authentication"
            ],
            "responses": {
              "200": {
                "description": "Response message",
                "schema": {
                  "$ref": "#/definitions/MessageDTO"
                }
              },
              "404": {
                "description": "User not found"
              },
              "500": {
                "description": "Unexpected"
              }
            }
          }
        },
        "/invitations": {
          "get": {
            "parameters": [],
            "description": "Get all invitations of my organisation",
            "tags": [
              "invitation"
            ],
            "responses": {
              "200": {
                "description": "An array of sent invitations",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Invitation"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "User is not a publisher"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          },
          "post": {
            "parameters": [
              {
                "name": "data",
                "in": "body",
                "description": "Invitation info",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/InvitationDTO"
                }
              }
            ],
            "description": "Invite new user to my organisation",
            "tags": [
              "invitation"
            ],
            "responses": {
              "200": {
                "description": "New invitation",
                "schema": {
                  "$ref": "#/definitions/Invitation"
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "User is not a publisher"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/me": {
          "get": {
            "parameters": [],
            "description": "Logged in user (with KYC info)",
            "tags": [
              "me"
            ],
            "responses": {
              "200": {
                "description": "Logged in user",
                "schema": {
                  "$ref": "#/definitions/User"
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          },
          "put": {
            "parameters": [
              {
                "name": "data",
                "in": "body",
                "description": "Updated user info",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/UpdateUserDTO"
                }
              }
            ],
            "description": "Update user profile",
            "tags": [
              "me"
            ],
            "responses": {
              "200": {
                "description": "Updated user",
                "schema": {
                  "$ref": "#/definitions/User"
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/me/password": {
          "put": {
            "parameters": [
              {
                "name": "data",
                "in": "body",
                "description": "Old and new password",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/ChangePasswordDTO"
                }
              }
            ],
            "description": "Update user password",
            "tags": [
              "me"
            ],
            "responses": {
              "200": {
                "description": "Success message",
                "schema": {
                  "$ref": "#/definitions/MessageDTO"
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/me/photos": {
          "get": {
            "parameters": [],
            "description": "Photos where user has rights, or is owner of",
            "tags": [
              "me"
            ],
            "responses": {
              "200": {
                "description": "Array of photos",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Media"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/me/organisation": {
          "get": {
            "parameters": [],
            "description": "Returns user's organisation",
            "tags": [
              "me"
            ],
            "responses": {
              "200": {
                "description": "User's organisation",
                "schema": {
                  "$ref": "#/definitions/Organisation"
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/organisations/{organisation}": {
          "get": {
            "parameters": [
              {
                "name": "organisation",
                "in": "path",
                "description": "Organisation name",
                "required": true,
                "type": "string"
              }
            ],
            "description": "Get organisation with wallet balance",
            "tags": [
              "organisations"
            ],
            "responses": {
              "200": {
                "description": "Organisation info with balance",
                "schema": {
                  "$ref": "#/definitions/OrganisationDTO"
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "404": {
                "description": "Organisation not found"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/photos": {
          "get": {
            "parameters": [
              {
                "name": "before",
                "in": "query",
                "description": "Optional - used for pagination. Gets all photos with createdAtUTC before given timestamp",
                "required": false,
                "type": "string"
              }
            ],
            "description": "Returns all photos",
            "tags": [
              "photos"
            ],
            "responses": {
              "200": {
                "description": "An array of photos",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Media"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "Forbidden"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          },
          "post": {
            "parameters": [
              {
                "name": "photo",
                "in": "body",
                "description": "New photo info",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/UploadPhotoDTO"
                }
              }
            ],
            "description": "Upload a new photo",
            "tags": [
              "photos"
            ],
            "responses": {
              "200": {
                "description": "The uploaded photo and the blockchain transaction"
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "Forbidden"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/photos/{hash}": {
          "get": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the photo",
                "required": true,
                "type": "string"
              }
            ],
            "description": "Returns a photo by its hash",
            "tags": [
              "photos"
            ],
            "responses": {
              "200": {
                "description": "A single photo"
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "Forbidden"
              },
              "404": {
                "description": "Photo not found"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          },
          "put": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the photo",
                "required": true,
                "type": "string"
              },
              {
                "name": "photo",
                "in": "body",
                "description": "Updated photo fields",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/UpdatePhotoDTO"
                }
              }
            ],
            "description": "Updates a photo by its hash",
            "tags": [
              "photos"
            ],
            "responses": {
              "200": {
                "description": "Updated photo"
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "Only photo owner can update photo info"
              },
              "404": {
                "description": "Photo not found"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/photos/comparison/{hash}": {
          "get": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the photo",
                "required": true,
                "type": "string"
              }
            ],
            "description": "Returns a comparison of aws and db hash",
            "tags": [
              "photos"
            ],
            "responses": {
              "200": {
                "description": "A single photo"
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "Forbidden"
              },
              "404": {
                "description": "Photo not found"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/photos/{hash}/pay": {
          "put": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the photo",
                "required": true,
                "type": "string"
              }
            ],
            "description": "Pay for a photo",
            "tags": [
              "photos"
            ],
            "responses": {
              "200": {
                "description": "The photo and the blockchain transaction"
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "Only ppublisher can pay for photo"
              },
              "404": {
                "description": "Photo not found"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/photos/search": {
          "post": {
            "parameters": [
              {
                "name": "before",
                "in": "query",
                "description": "Optional - Used for pagination. Gets photos with createdAtUTC before given timestamp",
                "required": false,
                "type": "string"
              },
              {
                "name": "type",
                "in": "query",
                "description": "Optional - Gets photos with given type (string)",
                "required": false,
                "type": "string"
              },
              {
                "name": "attribution",
                "in": "query",
                "description": "Optional - Gets photos with given attribution flag (boolean)",
                "required": false,
                "type": "string"
              },
              {
                "name": "priceGreaterThan",
                "in": "query",
                "description": "Optional - Gets photos with price greater than provided (numeric)",
                "required": false,
                "type": "string"
              },
              {
                "name": "priceLessThan",
                "in": "query",
                "description": "Optional - Gets photos with price less than provided (numeric)",
                "required": false,
                "type": "string"
              },
              {
                "name": "sold",
                "in": "query",
                "description": "Optional - Gets photos that are already sold or not (boolean)",
                "required": false,
                "type": "string"
              },
              {
                "name": "search",
                "in": "body",
                "description": "Search term",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/SearchPhotoDTO"
                }
              }
            ],
            "description": "Search for photos",
            "tags": [
              "photos"
            ],
            "responses": {
              "200": {
                "description": "An array of photos"
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/transactions": {
          "get": {
            "parameters": [
              {
                "name": "before",
                "in": "query",
                "description": "Optional - used for pagination. Gets all transactions with createdAtUTC before given timestamp",
                "required": false,
                "type": "string"
              }
            ],
            "description": "Get all transactions",
            "tags": [
              "transactions"
            ],
            "responses": {
              "200": {
                "description": "An array of transactions",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Transaction"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/transactions/photo/{hash}": {
          "get": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the photo",
                "required": true,
                "type": "string"
              },
              {
                "name": "before",
                "in": "query",
                "description": "Optional - used for pagination. Gets all transactions with createdAtUTC before given timestamp",
                "required": false,
                "type": "string"
              }
            ],
            "description": "Get all transactions for photo",
            "tags": [
              "transactions"
            ],
            "responses": {
              "200": {
                "description": "An array of transactions",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Transaction"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/transactions/me": {
          "get": {
            "parameters": [
              {
                "name": "before",
                "in": "query",
                "description": "Optional - used for pagination. Gets all transactions with createdAtUTC before given timestamp",
                "required": false,
                "type": "string"
              }
            ],
            "description": "Get all transactions for photo",
            "tags": [
              "transactions"
            ],
            "responses": {
              "200": {
                "description": "An array of transactions",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Transaction"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/transactions/check": {
          "get": {
            "parameters": [
              {
                "name": "before",
                "in": "transaction",
                "description": "Transaction hash to check",
                "required": true,
                "type": "string"
              }
            ],
            "description": "Check transaction status in the blockchain",
            "tags": [
              "transactions"
            ],
            "responses": {
              "200": {
                "description": "Transaction status object"
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/users": {
          "get": {
            "parameters": [],
            "description": "Get all approved users",
            "tags": [
              "users"
            ],
            "responses": {
              "200": {
                "description": "An array of users",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/User"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "User is not a publisher"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/users/kyc": {
          "get": {
            "parameters": [],
            "description": "Get all users with KYC requests",
            "tags": [
              "users"
            ],
            "responses": {
              "200": {
                "description": "An array of users",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/User"
                  }
                }
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "User is not a publisher"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/users/{hash}/kyc": {
          "get": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the user",
                "required": true,
                "type": "string"
              }
            ],
            "description": "Get user's KYC request",
            "tags": [
              "users"
            ],
            "responses": {
              "200": {
                "description": "Requested user"
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "User is not a publisher"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          },
          "put": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the user",
                "required": true,
                "type": "string"
              },
              {
                "name": "data",
                "in": "body",
                "description": "KYC approval",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/KYCApprovalDTO"
                }
              }
            ],
            "description": "Review user's KYC request",
            "tags": [
              "users"
            ],
            "responses": {
              "200": {
                "description": "Requested user"
              },
              "401": {
                "description": "Unauthorized"
              },
              "403": {
                "description": "User is not a publisher"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/users/{hash}/vote": {
          "put": {
            "parameters": [
              {
                "name": "hash",
                "in": "path",
                "description": "Unique hash of the user",
                "required": true,
                "type": "string"
              },
              {
                "name": "vote",
                "in": "body",
                "description": "Vote object",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/VoteDTO"
                }
              }
            ],
            "description": "Vote photographer",
            "tags": [
              "users"
            ],
            "responses": {
              "200": {
                "description": "Voted user"
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/wallet/send": {
          "get": {
            "parameters": [
              {
                "name": "data",
                "in": "body",
                "description": "Transaction info",
                "required": true,
                "schema": {
                  "$ref": "#/definitions/SendTokensDTO"
                }
              }
            ],
            "description": "Send funds to another user",
            "tags": [
              "wallet"
            ],
            "responses": {
              "200": {
                "description": "Blockchain response"
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        },
        "/wallet/mnemonic": {
          "get": {
            "parameters": [],
            "description": "Create new mnemonic wallet",
            "tags": [
              "wallet"
            ],
            "responses": {
              "200": {
                "description": "Newly created wallet"
              },
              "401": {
                "description": "Unauthorized"
              },
              "500": {
                "description": "Unexpected"
              }
            },
            "security": [
              {
                "JWT": []
              }
            ]
          }
        }
      },
      "definitions": {
        "Invitation": {
          "required": [
            "organisation",
            "email",
            "accepted"
          ],
          "properties": {
            "organisation": {
              "type": "string",
              "description": "Organisation name where the user is invited in"
            },
            "email": {
              "type": "string",
              "description": "User email where invitation is sent"
            },
            "accepted": {
              "type": "boolean",
              "description": "User accepted the invitation, default: false"
            },
            "user": {
              "$ref": "#/definitions/User"
            },
            "invitedBy": {
              "$ref": "#/definitions/User"
            },
            "createdAtUTC": {
              "type": "string",
              "description": "When invitation was sent"
            }
          }
        },
        "Media": {
          "required": [
            "url",
            "hash"
          ],
          "properties": {
            "url": {
              "type": "string",
              "description": "The media file URL"
            },
            "description": {
              "type": "string",
              "description": "Description of the media resource"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "hash": {
              "type": "string",
              "description": "Unique hash of the media resource"
            },
            "type": {
              "type": "string",
              "description": "Description of the resource, default is \"photo\""
            },
            "price": {
              "type": "integer",
              "description": "Price of the media resource, default is 0"
            },
            "attribution": {
              "type": "boolean",
              "description": "Uploader wants credit for media resource usage"
            },
            "owner": {
              "type": "string",
              "description": "Hash of media resource owner"
            },
            "rights": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "rightsTime": {
              "type": "string",
              "description": "Usage rights time (how long?)"
            },
            "rightsRegion": {
              "type": "string",
              "description": "Usage rights region (where in the world?)"
            },
            "analytics": {
              "type": "object",
              "description": "Not sure if this will be updated here, maybe different table for analytics"
            },
            "geo": {
              "type": "object",
              "description": "Geo coordinates"
            },
            "createdAtUTC": {
              "type": "string",
              "description": "When media resource was uploaded (type: Date)"
            }
          }
        },
        "Organisation": {
          "required": [
            "name",
            "hash",
            "walletAddress"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "Organisation name"
            },
            "hash": {
              "type": "string",
              "description": "Organisation hash"
            },
            "walletAddress": {
              "type": "object",
              "description": "Wallet address of the organisation"
            }
          }
        },
        "Transaction": {
          "required": [
            "hash"
          ],
          "properties": {
            "hash": {
              "type": "string",
              "description": "Transaction hash"
            },
            "type": {
              "type": "string",
              "description": "Transaction type, \"upload\" or \"payment\""
            },
            "mediaHash": {
              "type": "string",
              "description": "Hash of the media saved in DB"
            },
            "mediaId": {
              "type": "integer",
              "description": "Photo id saved in blockchain"
            },
            "payment": {
              "type": "number",
              "description": "Amount paid for media rights, default: 0"
            },
            "userHash": {
              "type": "string",
              "description": "User hash that initiated the transaction"
            },
            "receiverHash": {
              "type": "string",
              "description": "User hash that received the transaction"
            },
            "createdAtUTC": {
              "type": "string",
              "description": "When transaction was made"
            }
          }
        },
        "User": {
          "required": [
            "username",
            "hash",
            "password",
            "kyc"
          ],
          "properties": {
            "username": {
              "type": "string",
              "description": "Username"
            },
            "hash": {
              "type": "string",
              "description": "Unique hash of the user"
            },
            "password": {
              "type": "string",
              "description": "Password"
            },
            "email": {
              "type": "string",
              "description": "Email"
            },
            "role": {
              "type": "Array",
              "description": "Role of the user, default: \"photographer\""
            },
            "organisation": {
              "type": "string",
              "description": "User organisation, if user if photographer this is the same as the username"
            },
            "reputation": {
              "$ref": "#/definitions/reputation"
            },
            "settings": {
              "type": "object",
              "description": "User settings"
            },
            "kyc": {
              "$ref": "#/definitions/kyc"
            },
            "createdAtUTC": {
              "type": "string",
              "description": "When user first registered"
            }
          }
        },
        "reputation": {
          "required": null,
          "properties": {
            "positive": {
              "type": "integer",
              "description": "Upvotes"
            },
            "negative": {
              "type": "integer",
              "description": "Downvotes"
            }
          }
        },
        "kyc": {
          "required": null,
          "properties": {
            "address": {
              "type": "string",
              "description": "Physical address"
            },
            "phone": {
              "type": "string",
              "description": "Phone number"
            },
            "firstname": {
              "type": "string",
              "description": "Legal firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Legal lastname"
            },
            "id1": {
              "type": "string",
              "description": "ID photo"
            },
            "id2": {
              "type": "string",
              "description": "ID photo"
            },
            "status": {
              "type": "string",
              "description": "0: not uploaded, 1: uploaded, 2: declined, 3: approved"
            },
            "reviewedBy": {
              "type": "string",
              "description": "Hash of user that did the last status update (for statuses 2 or 3)"
            }
          }
        },
        "LoginDTO": {
          "required": [
            "username",
            "password"
          ],
          "properties": {
            "username": {
              "type": "string",
              "description": "Username"
            },
            "password": {
              "type": "string",
              "description": "Password"
            }
          }
        },
        "RegisterDTO": {
          "required": [
            "username",
            "password",
            "email"
          ],
          "properties": {
            "username": {
              "type": "string",
              "description": "Username"
            },
            "password": {
              "type": "string",
              "description": "Password"
            },
            "email": {
              "type": "string",
              "description": "Email"
            },
            "invitation": {
              "type": "string",
              "description": "Optional - invitation ID, only for publishers"
            }
          }
        },
        "ForgotDTO": {
          "required": [
            "email"
          ],
          "properties": {
            "email": {
              "type": "string",
              "description": "Email"
            }
          }
        },
        "JwtDTO": {
          "required": null,
          "properties": {
            "token": {
              "type": "string",
              "description": "JWT token"
            }
          }
        },
        "MessageDTO": {
          "required": [
            "message"
          ],
          "properties": {
            "message": {
              "type": "string",
              "description": "Message"
            }
          }
        },
        "InvitationDTO": {
          "required": [
            "email"
          ],
          "properties": {
            "email": {
              "type": "string",
              "description": "Email"
            }
          }
        },
        "ChangePasswordDTO": {
          "required": [
            "oldPassword",
            "newPassword"
          ],
          "properties": {
            "oldPassword": {
              "type": "string",
              "description": "User's old password"
            },
            "newPassword": {
              "type": "string",
              "description": "User's new password"
            }
          }
        },
        "UpdateUserDTO": {
          "required": null,
          "properties": {
            "email": {
              "type": "string",
              "description": "User's updated email"
            },
            "settings": {
              "type": "object",
              "description": "User's updated settings"
            },
            "organisation": {
              "type": "string",
              "description": "User's updated organisation"
            }
          }
        },
        "OrganisationDTO": {
          "required": [
            "name",
            "hash",
            "walletAddress",
            "balance"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "Organisation name"
            },
            "hash": {
              "type": "string",
              "description": "Organisation hash"
            },
            "walletAddress": {
              "type": "object",
              "description": "Wallet address of the organisation"
            },
            "balance": {
              "type": "string",
              "description": "Wallet balance"
            }
          }
        },
        "UpdatePhotoDTO": {
          "required": null,
          "properties": {
            "description": {
              "type": "string",
              "description": "Description"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "type": {
              "type": "number",
              "description": "Resource price, default 0"
            },
            "rightsTime": {
              "type": "string",
              "description": "Rights time"
            },
            "rightsRegion": {
              "type": "string",
              "description": "Rights region"
            },
            "geo": {
              "type": "object",
              "description": "Geo coordinates"
            }
          }
        },
        "UploadhotoDTO": {
          "required": null,
          "properties": {
            "base64": {
              "type": "string",
              "description": "Base64 data of image"
            },
            "price": {
              "type": "number",
              "description": "Price to purchase rights"
            },
            "attribution": {
              "type": "boolean",
              "description": "Should the publisher mention the photographer on usage?"
            },
            "description": {
              "type": "string",
              "description": "Description"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "type": {
              "type": "number",
              "description": "Resource price, default 0"
            },
            "rightsTime": {
              "type": "string",
              "description": "Rights time"
            },
            "rightsRegion": {
              "type": "string",
              "description": "Rights region"
            },
            "geo": {
              "type": "object",
              "description": "Geo coordinates"
            }
          }
        },
        "SearchPhotoDTO": {
          "required": [
            "term"
          ],
          "properties": {
            "term": {
              "type": "string",
              "description": "Term to search"
            }
          }
        },
        "SendTokensDTO": {
          "required": [
            "amount",
            "to"
          ],
          "properties": {
            "amount": {
              "type": "string",
              "description": "Amount to send"
            },
            "to": {
              "type": "string",
              "description": "Wallet address to send the tokens to"
            }
          }
        },
        "KYCRequestDTO": {
          "required": null,
          "properties": {
            "address": {
              "type": "string",
              "description": "Address"
            },
            "phone": {
              "type": "string",
              "description": "Phone number"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "id1": {
              "type": "string",
              "description": "ID - front side"
            },
            "id2": {
              "type": "string",
              "description": "ID - back side"
            }
          }
        },
        "KYCApprovalDTO": {
          "required": null,
          "properties": {
            "approve": {
              "type": "boolean",
              "description": "KYC approved"
            }
          }
        },
        "VoteDTO": {
          "required": null,
          "properties": {
            "vote": {
              "type": "number",
              "description": "Vote (+1 or -1)"
            }
          }
        }
      },
      "responses": {},
      "parameters": {},
      "tags": [
        {
          "name": "authentication",
          "description": "User authentication"
        },
        {
          "name": "invitation",
          "description": "Invitations for publishers"
        },
        {
          "name": "me",
          "description": "Logged in user functions"
        },
        {
          "name": "organisations",
          "description": "Operations about organisations"
        },
        {
          "name": "photos",
          "description": "Operations about photos"
        },
        {
          "name": "transactions",
          "description": "Operations about transactions"
        },
        {
          "name": "users",
          "description": "Operations about users"
        },
        {
          "name": "wallet",
          "description": "Wallet functions"
        }
      ]
    }
  }
}