{"info":{"title":"FARMBENV LCA Tool API","description":"The Application Programming Interface of the FARMBENV LCA Tool App is compatible with the latest OpenAPI Specification - Version 3.<p><a href=\"/jsonapi\">Get the schema in JSON</a></p>","version":"0.31"},"servers":[{"url":"https://backend.server.farmbenv.gr","description":"Production server (uses live data)"},{"url":"http://localhost:${process.env.PORT || 3031}","description":"Sandbox server (uses test data)"},{"url":"http://{environment}.local:3030","description":"Production server (uses live data)","variables":{"environment":{"enum":["dev","staging","production"],"default":"dev"}}}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"To get a bearer token you need to authenticate by calling POST/authentication"}},"schemas":{"authentication":{"type":"object","properties":{"email":{"type":"string","description":"Email used to log in"},"password":{"type":"string","description":"Password for the specific user"},"strategy":{"type":"string","enum":["local"],"description":"Authentication strategy is always local unless login with Google"}}},"authenticationResponse":{"type":"object","properties":{"accessToken":{"type":"string","description":"A JWT authorisation token to access restricted resources"},"authentication":{"type":"object","properties":{"strategy":{"type":"string","description":""},"payload":{"type":"string","description":""}}},"user":{"type":"object","properties":{"_id":{"type":"string","description":"User ID"},"email":{"type":"string","description":"User email"},"createdAt":{"type":"string","description":"The ISODate where user is created"},"updatedAt":{"type":"string","description":"The ISODate where user is updated"}}}}},"users":{"title":"users","properties":{"email":{"type":"string"},"password":{"type":"string"},"googleId":{"type":"string"},"oidcId":{"type":"string"},"disclaimer":{"type":"boolean"},"_id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"users_list":{"type":"array","items":{"title":"users","properties":{"email":{"type":"string"},"password":{"type":"string"},"googleId":{"type":"string"},"oidcId":{"type":"string"},"disclaimer":{"type":"boolean"},"_id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}},"projects":{"title":"projects","required":["score"],"properties":{"score":{"type":"number"},"settings":{"type":"object","properties":{}},"stages":{"type":"object","properties":{}},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"_id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"projects_list":{"type":"array","items":{"title":"projects","required":["score"],"properties":{"score":{"type":"number"},"settings":{"type":"object","properties":{}},"stages":{"type":"object","properties":{}},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"_id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}},"sensors":{"title":"sensors","required":["name","topic"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"unit":{"type":"string"},"topic":{"type":"string"},"_id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"sensors_list":{"type":"array","items":{"title":"sensors","required":["name","topic"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"unit":{"type":"string"},"topic":{"type":"string"},"_id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}}}},"paths":{"/authentication":{"post":{"tags":["authentication"],"summary":"Get new JWT","description":"Get new JWT to access restricted routes on FARMBENV LCA Tool API based on given user info","responses":{"201":{"description":"JWT returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/authenticationResponse"}}}},"401":{"description":"Unauthorized"}},"requestBody":{"description":"User information for login","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/authentication"}}}}}},"/users":{"get":{"parameters":[{"description":"Number of results to return","in":"query","name":"$limit","schema":{"type":"integer"}},{"description":"Number of results to skip","in":"query","name":"$skip","schema":{"type":"integer"}},{"description":"Property to sort results","in":"query","name":"$sort","style":"deepObject","schema":{"type":"object"}},{"description":"Query parameters to filter","in":"query","name":"filter","style":"form","explode":true,"schema":{"$ref":"#/components/schemas/users"}},{"description":"Property to query results","in":"query","name":"$select[]","schema":{"type":"array","items":{"type":"string"}},"allowReserved":true}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users_list"}}}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Retrieves a list of all resources from the service.","summary":"","tags":["users"],"security":[{"bearer":[]}]},"post":{"parameters":[],"responses":{"201":{"description":"created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Creates a new resource with data.","summary":"","tags":["users"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}}}},"/users/{_id}":{"get":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to retrieve"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Retrieves a single resource with the given id from the service.","summary":"","tags":["users"],"security":[{"bearer":[]}]},"put":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be updated"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Updates the resource identified by id using data.","summary":"","tags":["users"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}}},"patch":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be patched"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Updates the resource identified by id using data.","summary":"","tags":["users"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}}},"delete":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be permanently deleted"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Removes the resource with id.","summary":"","tags":["users"],"security":[{"bearer":[]}]}},"/projects":{"get":{"parameters":[{"description":"Number of results to return","in":"query","name":"$limit","schema":{"type":"integer"}},{"description":"Number of results to skip","in":"query","name":"$skip","schema":{"type":"integer"}},{"description":"Property to sort results","in":"query","name":"$sort","style":"deepObject","schema":{"type":"object"}},{"description":"Query parameters to filter","in":"query","name":"filter","style":"form","explode":true,"schema":{"$ref":"#/components/schemas/projects"}},{"description":"Property to query results","in":"query","name":"$select[]","schema":{"type":"array","items":{"type":"string"}},"allowReserved":true}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects_list"}}}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Retrieves a list of all resources from the service.","summary":"","tags":["projects"],"security":[{"bearer":[]}]},"post":{"parameters":[],"responses":{"201":{"description":"created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Creates a new resource with data.","summary":"","tags":["projects"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}}}},"/projects/{_id}":{"get":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to retrieve"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Retrieves a single resource with the given id from the service.","summary":"","tags":["projects"],"security":[{"bearer":[]}]},"put":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be updated"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Updates the resource identified by id using data.","summary":"","tags":["projects"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}}},"patch":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be patched"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Updates the resource identified by id using data.","summary":"","tags":["projects"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}}},"delete":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be permanently deleted"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/projects"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Removes the resource with id.","summary":"","tags":["projects"],"security":[{"bearer":[]}]}},"/sensors":{"get":{"parameters":[{"description":"Number of results to return","in":"query","name":"$limit","schema":{"type":"integer"}},{"description":"Number of results to skip","in":"query","name":"$skip","schema":{"type":"integer"}},{"description":"Property to sort results","in":"query","name":"$sort","style":"deepObject","schema":{"type":"object"}},{"description":"Query parameters to filter","in":"query","name":"filter","style":"form","explode":true,"schema":{"$ref":"#/components/schemas/sensors"}},{"description":"Property to query results","in":"query","name":"$select[]","schema":{"type":"array","items":{"type":"string"}},"allowReserved":true}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors_list"}}}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Retrieves a list of all resources from the service.","summary":"","tags":["sensors"],"security":[{"bearer":[]}]},"post":{"parameters":[],"responses":{"201":{"description":"created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Creates a new resource with data.","summary":"","tags":["sensors"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}}}},"/sensors/{_id}":{"get":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to retrieve"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Retrieves a single resource with the given id from the service.","summary":"","tags":["sensors"],"security":[{"bearer":[]}]},"put":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be updated"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Updates the resource identified by id using data.","summary":"","tags":["sensors"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}}},"patch":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be patched"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Updates the resource identified by id using data.","summary":"","tags":["sensors"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}}},"delete":{"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string"},"description":"The ObjectId to be permanently deleted"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/sensors"}}}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Removes the resource with id.","summary":"","tags":["sensors"],"security":[{"bearer":[]}]}}},"security":[{"bearer":[]}],"openapi":"3.0.2","tags":[{"name":"users","description":"Service for user management of LCA Calculator"},{"name":"projects","description":"Service for managing LCA Calculator projects (aka: workflows)"},{"name":"sensors","description":"Service for managing connection of LCA Calculator Engine with socket based sensors"}]}