arol-polito / AROL-CLOUD

MIT License
2 stars 2 forks source link

AROL-CLOUD (SDP Projects 2023-2024)

How to run project locally

Set up env file:

Step 1: cd ./express-server and create a file name ".env"

Step 2: Paste the following content in it

JWT_SECRET_KEY=6c9c23d766e7cf2280dfdb8fca8f97841ddcd80eee01eb0cbaff85037848962f
JWT_EXPIRATION=900000
REFRESH_TOKEN_SECRET_KEY=47e648a61b5c7c8b3d12bb9c46dbc64f35fd2d3fb22bfc5debc9d7cf6036ff1b
REFRESH_TOKEN_EXPIRATION=2592000000
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
MONGODB_HOST=localhost
MONGODB_PORT=27017

Important note

To run project locally, PostgreSQL and MongoDB need to be installed in the system. DB configuration scripts/exports for both DBMS-es can be found under Docker/pg and Docker/mongo/data dirs. These exports need to be imported into the corresponding DBMS manually.

Run server

Step 1: cd ./express-server

Step 2: npm install --force

Step 3: npm run start:dev

Run client

Step 1: cd ./react-client

Step 2: npm install --force

Step 3: npm run start

How to run project with Docker

Step 1: Make sure you have Docker installed locally on your system

Step 2: cd ./Docker

Step 3: docker compose up --build

Step 4: Open Docker Desktop and make sure to run all the containers under the "arol-cloud" container

Step 5: Open http://localhost:3000 on you favourite browser

PostgreSQL credentials

username: postgres password: postgres port: 5432

DB Schema

DB Schema

Available users and credentials

User 1

username: mariodeda@hotmail.com
password: 123
roles: Administrator

User 2

username: mariodeda2@hotmail.com
password: 123
roles: Worker

User 3

username: test2@hotmail.com
password: 12345678
roles: Worker

User 4

username: worker@hotmail.com
password: 12345678
roles: Worker, Manager

API Documentation

Base URLs:

Email: Support

Authentication

public

Public operations (no auth token needed)

post__public_login

POST /public/login

Initial authentication

Perform initial authentication to obtain JWT auth token

Body parameter

{
  "email": "example@email.com",
  "password": 12345678
}

Parameters

Name In Type Required Description
body body LoginCredentials true none
» email body string true none
» password body string true none

Example responses

200 Response

{
  "id": 0,
  "companyID": "string",
  "name": "string",
  "surname": "string",
  "email": "string",
  "roles": [
    "string"
  ],
  "authToken": "string",
  "authTokenExpiration": 0,
  "refreshToken": "string",
  "refreshTokenExpiry": 0,
  "permissions": {
    "machineryUID": {
      "dashboardsWrite": true,
      "dashboardsModify": true,
      "dashboardsRead": true,
      "documentsWrite": true,
      "documentsModify": true,
      "documentsRead": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation LoginResponse
403 Forbidden Bad credentials or account disabled None

post__public_logout

POST /public/logout

Logout

Perform logout and delete any refresh tokens associated to this session

Parameters

Name In Type Required Description
id query integer false none
token query string false none

Responses

Status Meaning Description Schema
200 OK Logout successful None

get__public_refreshtoken

GET /public/refreshtoken

JWT token refresh

Refresh JWT token by providing a valid refresh token

Parameters

Name In Type Required Description
id query integer false none
token query string false none

Example responses

200 Response

{
  "id": 0,
  "companyID": "string",
  "name": "string",
  "surname": "string",
  "email": "string",
  "roles": [
    "string"
  ],
  "authToken": "string",
  "authTokenExpiration": 0,
  "refreshToken": "string",
  "refreshTokenExpiry": 0,
  "permissions": {
    "machineryUID": {
      "dashboardsWrite": true,
      "dashboardsModify": true,
      "dashboardsRead": true,
      "documentsWrite": true,
      "documentsModify": true,
      "documentsRead": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Token refresh successful LoginResponse
400 Bad Request Invalid refresh token None
401 Unauthorized Invalid refresh token None
403 Forbidden Account disabled None

get__public_status

GET /public/status

Health

Check server health

Responses

Status Meaning Description Schema
200 OK Server is on and accepting requests None

company

Operations about AROL customer companies

get__company

GET /company

Company information

Get the current authenticated user company information

Example responses

200 Response

{
  "id": 0,
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK Company details CompanyResponse
401 Unauthorized Authentication failed None
404 Not Found No company found for the authenticated user None

machinery

Operations on customer company machineries

get__machinery_company

GET /machinery/company

Company machineries

Get all the authenticated user company machineries

Example responses

200 Response

{
  "locationCluster": [
    {
      "uid": "string",
      "companyID": 0,
      "modelID": "string",
      "modelName": "string",
      "modelType": "string",
      "geoLocation": {
        "x": 0,
        "y": 0
      },
      "locationCluster": "string",
      "numHeads": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Company machineries groupped by their corresponding location cluster. Each cluster contains the actual array of machineries that belong to that cluster. CompanyMachineriesResponse
400 Bad Request Invalid company ID detected None
401 Unauthorized Authentication failed None

get__machinerycompany{machineryUID}

GET /machinery/company/{machineryUID}

Machinery by its UID

Get the authenticated user company machinery by its UID

Parameters

Name In Type Required Description
machineryUID path string true The UID of the desired machinery

Example responses

200 Response

{
  "uid": "string",
  "companyID": 0,
  "modelID": "string",
  "modelName": "string",
  "modelType": "string",
  "geoLocation": {
    "x": 0,
    "y": 0
  },
  "locationCluster": "string",
  "numHeads": 0
}

Responses

Status Meaning Description Schema
200 OK Machinery information MachineryResponse
400 Bad Request Invalid company ID detected None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Machinery with this UID and that belongs the authenticated user company not found None

get__machinery_sensors

GET /machinery/sensors

Machinery sensors by its UID

Get the authenticated user company machinery sensors by its UID

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery

Example responses

200 Response

[
  {
    "machineryUID": "string",
    "name": "string",
    "description": "string",
    "unit": "string",
    "thresholdLow": 0,
    "thresholdHigh": 0,
    "internalName": "string",
    "category": "string",
    "type": "string",
    "isHeadMounted": true,
    "bucketingType": "string",
    "imgFilename": 0,
    "imgPointerLocation": {
      "x": 0,
      "y": 0
    }
  }
]

Responses

Status Meaning Description Schema
200 OK Machinery sensors information MachinerySensorsResponse
400 Bad Request Invalid company ID detected None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

post__machinery_sensors_data

POST /machinery/sensors/data

Machinery sensors data by its UID

Get the authenticated user company machinery sensors data by its UID. The returned data will be filtered using the parameters sent using the request body.

Body parameter

{
  "sensorFilters": {
    "requestType": "string",
    "cacheDataRequestMaxTime": 0,
    "newDataRequestMinTime": 0,
    "widgetCategory": "string",
    "dataRange": {
      "amount": 0,
      "unit": "string"
    },
    "sensors": {
      "sensorName": [
        {
          "headNumber": 0,
          "mechNumber": 0,
          "sensorNames": [
            {
              "name": "string",
              "color": "string"
            }
          ]
        }
      ]
    },
    "aggregations": [
      {
        "name": "string",
        "color": "string"
      }
    ]
  }
}

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
body body MachineryDataRequest true none
» sensorFilters body object false none
»» requestType body string false none
»» cacheDataRequestMaxTime body number false none
»» newDataRequestMinTime body number false none
»» widgetCategory body string false none
»» dataRange body object false none
»»» amount body number false none
»»» unit body string false none
»» sensors body object false none
»»» sensorName body [object] false none
»»»» headNumber body number false none
»»»» mechNumber body number false none
»»»» sensorNames body [object] false none
»»»»» name body string false none
»»»»» color body string false none
»» aggregations body [object] false none
»»» name body string false none
»»» color body string false none

Example responses

200 Response

{
  "requestType": "string",
  "minDisplayTime": 0,
  "cachedSensorData": {
    "active": true,
    "machineryOff": true,
    "machineryOffFrom": 0,
    "machineryOffTo": 0,
    "time": 0,
    "minTime": 0,
    "maxTime": 0,
    "formattedTime": "string",
    "activeData": {
      "sensorInternalName": 0
    },
    "fillerData": {
      "sensorInternalName": 0
    },
    "allData": {
      "sensorInternalName": 0
    },
    "aggregationData": {
      "aggregationName": {
        "value": 0,
        "note": "string"
      }
    }
  },
  "displaySensorData": {
    "active": true,
    "machineryOff": true,
    "machineryOffFrom": 0,
    "machineryOffTo": 0,
    "time": 0,
    "minTime": 0,
    "maxTime": 0,
    "formattedTime": "string",
    "activeData": {
      "sensorInternalName": 0
    },
    "fillerData": {
      "sensorInternalName": 0
    },
    "allData": {
      "sensorInternalName": 0
    },
    "aggregationData": {
      "aggregationName": {
        "value": 0,
        "note": "string"
      }
    }
  },
  "newSensorData": {
    "active": true,
    "machineryOff": true,
    "machineryOffFrom": 0,
    "machineryOffTo": 0,
    "time": 0,
    "minTime": 0,
    "maxTime": 0,
    "formattedTime": "string",
    "activeData": {
      "sensorInternalName": 0
    },
    "fillerData": {
      "sensorInternalName": 0
    },
    "allData": {
      "sensorInternalName": 0
    },
    "aggregationData": {
      "aggregationName": {
        "value": 0,
        "note": "string"
      }
    }
  },
  "numSensorData": 0,
  "endOfData": true
}

Responses

Status Meaning Description Schema
200 OK Machinery sensors data MachineryDataResponse
400 Bad Request Invalid company ID detected None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

users

Public operations (no auth token needed)

get__users_company

GET /users/company

Company users

Get all company users (Admin only)

Example responses

200 Response

[
  {
    "id": 0,
    "email": "string",
    "name": "string",
    "surname": "string",
    "roles": [
      "string"
    ],
    "active": true,
    "companyID": 0,
    "createdAt": 0,
    "createdBy": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Company users CompanyUsers
400 Bad Request Invalid company ID None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

post__users_create

POST /users/create

Create new user account

Create a new user account (Admin or Manager roles only)

Body parameter

{
  "email": "string",
  "password": "string",
  "name": "string",
  "surname": "string",
  "roles": [
    "string"
  ],
  "companyID": 0,
  "permissions": {
    "machineryUID": {
      "dashboardsWrite": true,
      "dashboardsModify": true,
      "dashboardsRead": true,
      "documentsWrite": true,
      "documentsModify": true,
      "documentsRead": true
    }
  }
}

Parameters

Name In Type Required Description
body body CreateAccountRequest false Account data
» email body string false none
» password body string false none
» name body string false none
» surname body string false none
» roles body [string] false none
» companyID body number¦null false none
» permissions body object false none
»» machineryUID body object false none
»»» dashboardsWrite body boolean false none
»»» dashboardsModify body boolean false none
»»» dashboardsRead body boolean false none
»»» documentsWrite body boolean false none
»»» documentsModify body boolean false none
»»» documentsRead body boolean false none

Example responses

200 Response

{
  "email": "string",
  "password": "string",
  "name": "string",
  "surname": "string",
  "roles": [
    "string"
  ],
  "companyID": 0,
  "permissions": {
    "machineryUID": {
      "dashboardsWrite": true,
      "dashboardsModify": true,
      "dashboardsRead": true,
      "documentsWrite": true,
      "documentsModify": true,
      "documentsRead": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Created account CreateAccountRequest
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

post__users_details_update

POST /users/details/update

Update user account details

Update user accounts details

Body parameter

{
  "id": 0,
  "email": "string",
  "name": "string",
  "surname": "string",
  "roles": "string",
  "active": true
}

Parameters

Name In Type Required Description
body body UpdateAccountRequest false New account details
» id body number false none
» email body string false none
» name body string false none
» surname body string false none
» roles body string false none
» active body boolean false none

Responses

Status Meaning Description Schema
200 OK Account details updated None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

post__users_password_reset

POST /users/password/reset

Reset account password

Reset account password and invalidate any refresh tokens associated to the given user

Body parameter

{
  "id": 0,
  "password": "string"
}

Parameters

Name In Type Required Description
body body PasswordResetRequest false Password reset data
» id body number false none
» password body string false none

Responses

Status Meaning Description Schema
200 OK Password succesfully reset None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

get__users_permissions

GET /users/permissions

User permissions

Get user permissions wrt to the given machinery UID. If machinery UID is not provided, the list of all users permissions will be returned. The response body will be an array of permission objects.

Example responses

200 Response

{
  "userID": 0,
  "machineryUID": "string",
  "dashboardsWrite": true,
  "dashboardsModify": true,
  "dashboardsRead": true,
  "documentsWrite": true,
  "documentsModify": true,
  "documentsRead": true
}

Responses

Status Meaning Description Schema
200 OK User permissions wrt given machinery UID UserPermissionsResponse
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

post__users_permissions_update

POST /users/permissions/update

Update user permissions

Update user permissions

Body parameter

{
  "userID": 0,
  "machineryUID": "string",
  "dashboardsWrite": true,
  "dashboardsModify": true,
  "dashboardsRead": true,
  "documentsWrite": true,
  "documentsModify": true,
  "documentsRead": true
}

Parameters

Name In Type Required Description
body body UserPermissionsRequest false New user permissions
» userID body number false none
» machineryUID body string false none
» dashboardsWrite body boolean false none
» dashboardsModify body boolean false none
» dashboardsRead body boolean false none
» documentsWrite body boolean false none
» documentsModify body boolean false none
» documentsRead body boolean false none

Responses

Status Meaning Description Schema
200 OK Permissions updated successfully None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

dashboards

Operations on customer company machinery dashboards

post__dashboard_save

POST /dashboard/save

Save dashboard configuration

Save dashboard configuration for the given machinery

Body parameter

{
  "dashboard": {}
}

Parameters

Name In Type Required Description
body body SaveDashboardRequest false none
» dashboard body object false none

Responses

Status Meaning Description Schema
200 OK Dashboard config saved successfully None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Dashboard could not be saved None

post__dashboard_saveas

POST /dashboard/saveas

Save dashboard configuration as a new dashboard

Save dashboard configuration as a new dashboard for the given machinery. This will ensure that the dashboard name is unique for the given machinery.

Body parameter

{
  "dashboard": {}
}

Parameters

Name In Type Required Description
body body SaveDashboardRequest false none
» dashboard body object false none

Responses

Status Meaning Description Schema
200 OK Dashboard config saved successfully None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
409 Conflict Dashboard could not be saved since another dashboard with this name already exists for this machinery None

delete__dashboard_delete

DELETE /dashboard/delete

Delete dashboard configuration

Delete dashboard configuration for the given machinery

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
dashboardName query string true The name of the dashboard to delete

Responses

Status Meaning Description Schema
200 OK Dashboard deleted successfully None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found A dashboard with the given name and for the given machinery UID could not be found None

get__dashboard_load

GET /dashboard/load

Load dashboard configuration

Load dashboard configuration for the given machinery

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
dashboardName query string true The name of the dashboard to load

Example responses

200 Response

{
  "name": "string",
  "machineryUID": "string",
  "timestamp": 0,
  "userID": 0,
  "isDefault": true,
  "numUnsavedChanges": 0,
  "lastSave": 0,
  "isNew": true,
  "numCols": 0,
  "numRows": 0,
  "gridCompaction": "string",
  "grid": {
    "widgets": [
      {
        "id": "string",
        "name": "string",
        "type": "string",
        "maxSensors": 0,
        "sensorsMonitoring": {
          "dataRange": {
            "amount": 0,
            "unit": "string"
          },
          "sensors": [
            {
              "headNumber": 0,
              "mechNumber": 0,
              "sensorNames": [
                {
                  "name": "string",
                  "color": "string"
                }
              ]
            }
          ],
          "aggregations": [
            {
              "name": "string",
              "color": "string"
            }
          ]
        }
      }
    ],
    "layout": []
  }
}

Responses

Status Meaning Description Schema
200 OK Dashboard configuration Dashboard
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found A dashboard with the given name and for the given machinery UID could not be found None

get__dashboard_load_default

GET /dashboard/load/default

Load the default dashboard configuration

Load the default dashboard configuration for the given machinery

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery

Example responses

200 Response

{
  "name": "string",
  "machineryUID": "string",
  "timestamp": 0,
  "userID": 0,
  "isDefault": true,
  "numUnsavedChanges": 0,
  "lastSave": 0,
  "isNew": true,
  "numCols": 0,
  "numRows": 0,
  "gridCompaction": "string",
  "grid": {
    "widgets": [
      {
        "id": "string",
        "name": "string",
        "type": "string",
        "maxSensors": 0,
        "sensorsMonitoring": {
          "dataRange": {
            "amount": 0,
            "unit": "string"
          },
          "sensors": [
            {
              "headNumber": 0,
              "mechNumber": 0,
              "sensorNames": [
                {
                  "name": "string",
                  "color": "string"
                }
              ]
            }
          ],
          "aggregations": [
            {
              "name": "string",
              "color": "string"
            }
          ]
        }
      }
    ],
    "layout": []
  }
}

Responses

Status Meaning Description Schema
200 OK Dashboard configuration Dashboard
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found A dashboard with the given name and for the given machinery UID could not be found None

get__dashboard_saved

GET /dashboard/saved

Get list of saved dashboards

Get list of saved dashboards for the given machinery

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery

Example responses

200 Response

{
  "savedDashboards": [
    {
      "name": "string",
      "isDefault": true,
      "machineryUID": "string",
      "timestamp": 0,
      "numSensorsMonitored": 0,
      "numWidgets": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Saved dashboards SavedDashboards
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

get__dashboard_templates

GET /dashboard/templates

Get list of dashboard templates

Get list of dashboard templates for the given machinery. Templates are dashboard configurations for machineries of the same model but with no sensors selected for monitoring.

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery

Example responses

200 Response

{
  "templateDashboards": [
    {
      "name": "string",
      "isDefault": true,
      "machineryUID": "string",
      "timestamp": 0,
      "numSensorsMonitored": 0,
      "numWidgets": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Dashboards templates SavedDashboardTemplates
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None

documents

Operations on customer company machinery documents

get__documents

GET /documents

Machinery documents

Get the authenticated user company machinery documents by its UID.

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery

Example responses

200 Response

{
  "rootFolderId": "string",
  "childrenIds": [
    "string"
  ],
  "fileMap": {
    "fileID": {
      "id": "string",
      "name": "string",
      "documentUID": "string",
      "isDir": true,
      "isDocument": true,
      "isModifiable": true,
      "childrenIds": [
        "string"
      ],
      "childrenCount": 0,
      "parentId": "string",
      "modDate": "2019-08-24T14:15:22Z",
      "size": 0
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Machinery documents MachineryDocuments
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Machinery with this UID and that belongs the authenticated user company not found None

delete__documents

DELETE /documents

Delete machinery documents/folders

Delete one or multiple documents and/or folders for the given machinery UID

Body parameter

{
  "documentsList": [
    {
      "id": "string",
      "documentUID": "string"
    }
  ]
}

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
body body MachineryDeleteFilesRequest true none
» documentsList body [object] false none
»» id body string false none
»» documentUID body string false none

Responses

Status Meaning Description Schema
200 OK Machinery folder created successfully None
400 Bad Request Bad document path None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Machinery with this UID and that belongs the authenticated user company not found None

get__documents_document

GET /documents/document

Machinery documents

Get the authenticated user company machinery documents by its UID.

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
documentUID query string true The UID of the desired machinery document

Responses

Status Meaning Description Schema
200 OK Machinery document None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Machinery with this UID and that belongs the authenticated user company not found None

post__documents_rename

POST /documents/rename

Rename machinery document

Rename a machinery document.

Body parameter

{
  "oldFileID": "string",
  "documentUID": "string",
  "newFileName": "string",
  "type": "string"
}

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
body body MachineryDocumentRenameRequest true none
» oldFileID body string false none
» documentUID body string false none
» newFileName body string false none
» type body string false none

Responses

Status Meaning Description Schema
200 OK Machinery document renamed successfully None
400 Bad Request Bad document path None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Machinery with this UID and that belongs the authenticated user company not found None

put__documents_folder

PUT /documents/folder

Create machinery folder

Create folder for the given machinery UID

Body parameter

{
  "folderPath": "string"
}

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
body body MachineryCreateFolderRequest true none
» folderPath body string false none

Responses

Status Meaning Description Schema
200 OK Machinery folder created successfully None
400 Bad Request Bad document path None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Machinery with this UID and that belongs the authenticated user company not found None

put__documents_files

PUT /documents/files

Upload machinery documents

Upload one or multiple documents for the given machinery UID

Body parameter

{
  "parentFolderPath": "string"
}

Parameters

Name In Type Required Description
machineryUID query string true The UID of the desired machinery
body body MachineryUploadFilesRequest true none
» parentFolderPath body string false none

Responses

Status Meaning Description Schema
200 OK Machinery folder created successfully None
400 Bad Request Bad document path None
401 Unauthorized Authentication failed None
403 Forbidden Insufficient permissions None
404 Not Found Machinery with this UID and that belongs the authenticated user company not found None

Schemas

LoginCredentials

{
  "email": "example@email.com",
  "password": 12345678
}

Properties

Name Type Required Restrictions Description
email string true none none
password string true none none

LoginResponse

{
  "id": 0,
  "companyID": "string",
  "name": "string",
  "surname": "string",
  "email": "string",
  "roles": [
    "string"
  ],
  "authToken": "string",
  "authTokenExpiration": 0,
  "refreshToken": "string",
  "refreshTokenExpiry": 0,
  "permissions": {
    "machineryUID": {
      "dashboardsWrite": true,
      "dashboardsModify": true,
      "dashboardsRead": true,
      "documentsWrite": true,
      "documentsModify": true,
      "documentsRead": true
    }
  }
}

Properties

Name Type Required Restrictions Description
id number false none none
companyID string false none none
name string false none none
surname string false none none
email string false none none
roles [string] false none none
authToken string false none none
authTokenExpiration number false none none
refreshToken string false none none
refreshTokenExpiry number false none none
permissions object false none none
» machineryUID object false none none
»» dashboardsWrite boolean false none none
»» dashboardsModify boolean false none none
»» dashboardsRead boolean false none none
»» documentsWrite boolean false none none
»» documentsModify boolean false none none
»» documentsRead boolean false none none

CompanyResponse

{
  "id": 0,
  "name": "string"
}

Properties

Name Type Required Restrictions Description
id number false none none
name string false none none

CompanyMachineriesResponse

{
  "locationCluster": [
    {
      "uid": "string",
      "companyID": 0,
      "modelID": "string",
      "modelName": "string",
      "modelType": "string",
      "geoLocation": {
        "x": 0,
        "y": 0
      },
      "locationCluster": "string",
      "numHeads": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
locationCluster [object] false none none
» uid string false none none
» companyID number false none none
» modelID string false none none
» modelName string false none none
» modelType string false none none
» geoLocation object false none none
»» x number false none none
»» y number false none none
» locationCluster string false none none
» numHeads number false none none

MachineryResponse

{
  "uid": "string",
  "companyID": 0,
  "modelID": "string",
  "modelName": "string",
  "modelType": "string",
  "geoLocation": {
    "x": 0,
    "y": 0
  },
  "locationCluster": "string",
  "numHeads": 0
}

Properties

Name Type Required Restrictions Description
uid string false none none
companyID number false none none
modelID string false none none
modelName string false none none
modelType string false none none
geoLocation object false none none
» x number false none none
» y number false none none
locationCluster string false none none
numHeads number false none none

MachinerySensorsResponse

[
  {
    "machineryUID": "string",
    "name": "string",
    "description": "string",
    "unit": "string",
    "thresholdLow": 0,
    "thresholdHigh": 0,
    "internalName": "string",
    "category": "string",
    "type": "string",
    "isHeadMounted": true,
    "bucketingType": "string",
    "imgFilename": 0,
    "imgPointerLocation": {
      "x": 0,
      "y": 0
    }
  }
]

Properties

Name Type Required Restrictions Description
machineryUID string false none none
name string false none none
description string false none none
unit string false none none
thresholdLow number false none none
thresholdHigh number false none none
internalName string false none none
category string false none none
type string false none none
isHeadMounted boolean false none none
bucketingType string false none none
imgFilename number false none none
imgPointerLocation object false none none
» x number false none none
» y number false none none

MachineryDataRequest

{
  "sensorFilters": {
    "requestType": "string",
    "cacheDataRequestMaxTime": 0,
    "newDataRequestMinTime": 0,
    "widgetCategory": "string",
    "dataRange": {
      "amount": 0,
      "unit": "string"
    },
    "sensors": {
      "sensorName": [
        {
          "headNumber": 0,
          "mechNumber": 0,
          "sensorNames": [
            {
              "name": "string",
              "color": "string"
            }
          ]
        }
      ]
    },
    "aggregations": [
      {
        "name": "string",
        "color": "string"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
sensorFilters object false none none
» requestType string false none none
» cacheDataRequestMaxTime number false none none
» newDataRequestMinTime number false none none
» widgetCategory string false none none
» dataRange object false none none
»» amount number false none none
»» unit string false none none
» sensors object false none none
»» sensorName [object] false none none
»»» headNumber number false none none
»»» mechNumber number false none none
»»» sensorNames [object] false none none
»»»» name string false none none
»»»» color string false none none
» aggregations [object] false none none
»» name string false none none
»» color string false none none

MachineryDataResponse

{
  "requestType": "string",
  "minDisplayTime": 0,
  "cachedSensorData": {
    "active": true,
    "machineryOff": true,
    "machineryOffFrom": 0,
    "machineryOffTo": 0,
    "time": 0,
    "minTime": 0,
    "maxTime": 0,
    "formattedTime": "string",
    "activeData": {
      "sensorInternalName": 0
    },
    "fillerData": {
      "sensorInternalName": 0
    },
    "allData": {
      "sensorInternalName": 0
    },
    "aggregationData": {
      "aggregationName": {
        "value": 0,
        "note": "string"
      }
    }
  },
  "displaySensorData": {
    "active": true,
    "machineryOff": true,
    "machineryOffFrom": 0,
    "machineryOffTo": 0,
    "time": 0,
    "minTime": 0,
    "maxTime": 0,
    "formattedTime": "string",
    "activeData": {
      "sensorInternalName": 0
    },
    "fillerData": {
      "sensorInternalName": 0
    },
    "allData": {
      "sensorInternalName": 0
    },
    "aggregationData": {
      "aggregationName": {
        "value": 0,
        "note": "string"
      }
    }
  },
  "newSensorData": {
    "active": true,
    "machineryOff": true,
    "machineryOffFrom": 0,
    "machineryOffTo": 0,
    "time": 0,
    "minTime": 0,
    "maxTime": 0,
    "formattedTime": "string",
    "activeData": {
      "sensorInternalName": 0
    },
    "fillerData": {
      "sensorInternalName": 0
    },
    "allData": {
      "sensorInternalName": 0
    },
    "aggregationData": {
      "aggregationName": {
        "value": 0,
        "note": "string"
      }
    }
  },
  "numSensorData": 0,
  "endOfData": true
}

Properties

Name Type Required Restrictions Description
requestType string false none none
minDisplayTime number false none none
cachedSensorData SensorData false none none
displaySensorData SensorData false none none
newSensorData SensorData false none none
numSensorData number false none none
endOfData boolean false none none

SensorData

{
  "active": true,
  "machineryOff": true,
  "machineryOffFrom": 0,
  "machineryOffTo": 0,
  "time": 0,
  "minTime": 0,
  "maxTime": 0,
  "formattedTime": "string",
  "activeData": {
    "sensorInternalName": 0
  },
  "fillerData": {
    "sensorInternalName": 0
  },
  "allData": {
    "sensorInternalName": 0
  },
  "aggregationData": {
    "aggregationName": {
      "value": 0,
      "note": "string"
    }
  }
}

Properties

Name Type Required Restrictions Description
active boolean false none none
machineryOff boolean false none none
machineryOffFrom number false none none
machineryOffTo number false none none
time number false none none
minTime number false none none
maxTime number false none none
formattedTime string false none none
activeData object false none none
» sensorInternalName number¦null false none none
fillerData object false none none
» sensorInternalName number¦null false none none
allData object false none none
» sensorInternalName number¦null false none none
aggregationData object false none none
» aggregationName object false none none
»» value number false none none
»» note string false none none

MachineryDocuments

{
  "rootFolderId": "string",
  "childrenIds": [
    "string"
  ],
  "fileMap": {
    "fileID": {
      "id": "string",
      "name": "string",
      "documentUID": "string",
      "isDir": true,
      "isDocument": true,
      "isModifiable": true,
      "childrenIds": [
        "string"
      ],
      "childrenCount": 0,
      "parentId": "string",
      "modDate": "2019-08-24T14:15:22Z",
      "size": 0
    }
  }
}

Properties

Name Type Required Restrictions Description
rootFolderId string false none none
childrenIds [string] false none none
fileMap object false none none
» fileID object false none none
»» id string false none none
»» name string false none none
»» documentUID string false none none
»» isDir boolean false none none
»» isDocument boolean false none none
»» isModifiable boolean false none none
»» childrenIds [string] false none none
»» childrenCount number false none none
»» parentId string false none none
»» modDate string(date-time) false none none
»» size number false none File size in bytes

MachineryDocumentRenameRequest

{
  "oldFileID": "string",
  "documentUID": "string",
  "newFileName": "string",
  "type": "string"
}

Properties

Name Type Required Restrictions Description
oldFileID string false none none
documentUID string false none none
newFileName string false none none
type string false none none

MachineryCreateFolderRequest

{
  "folderPath": "string"
}

Properties

Name Type Required Restrictions Description
folderPath string false none none

MachineryUploadFilesRequest

{
  "parentFolderPath": "string"
}

Properties

Name Type Required Restrictions Description
parentFolderPath string false none none

MachineryDeleteFilesRequest

{
  "documentsList": [
    {
      "id": "string",
      "documentUID": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
documentsList [object] false none none
» id string false none none
» documentUID string false none none

SaveDashboardRequest

{
  "dashboard": {}
}

Properties

Name Type Required Restrictions Description
dashboard object false none none

Dashboard

{
  "name": "string",
  "machineryUID": "string",
  "timestamp": 0,
  "userID": 0,
  "isDefault": true,
  "numUnsavedChanges": 0,
  "lastSave": 0,
  "isNew": true,
  "numCols": 0,
  "numRows": 0,
  "gridCompaction": "string",
  "grid": {
    "widgets": [
      {
        "id": "string",
        "name": "string",
        "type": "string",
        "maxSensors": 0,
        "sensorsMonitoring": {
          "dataRange": {
            "amount": 0,
            "unit": "string"
          },
          "sensors": [
            {
              "headNumber": 0,
              "mechNumber": 0,
              "sensorNames": [
                {
                  "name": "string",
                  "color": "string"
                }
              ]
            }
          ],
          "aggregations": [
            {
              "name": "string",
              "color": "string"
            }
          ]
        }
      }
    ],
    "layout": []
  }
}

Properties

Name Type Required Restrictions Description
name string false none none
machineryUID string false none none
timestamp number false none none
userID number false none none
isDefault boolean false none none
numUnsavedChanges number false none none
lastSave number false none none
isNew boolean false none none
numCols number false none none
numRows number false none none
gridCompaction string¦null false none none
grid object false none none
» widgets [object] false none none
»» id string false none none
»» name string false none none
»» type string false none none
»» maxSensors number false none none
»» sensorsMonitoring object false none none
»»» dataRange object false none none
»»»» amount number false none none
»»»» unit string false none none
»»» sensors [object] false none none
»»»» headNumber number false none none
»»»» mechNumber number false none none
»»»» sensorNames [object] false none none
»»»»» name string false none none
»»»»» color string false none none
»»» aggregations [object] false none none
»»»» name string false none none
»»»» color string false none none
» layout array false none none

SavedDashboards

{
  "savedDashboards": [
    {
      "name": "string",
      "isDefault": true,
      "machineryUID": "string",
      "timestamp": 0,
      "numSensorsMonitored": 0,
      "numWidgets": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
savedDashboards [object] false none none
» name string false none none
» isDefault boolean false none none
» machineryUID string false none none
» timestamp number false none none
» numSensorsMonitored number false none none
» numWidgets number false none none

SavedDashboardTemplates

{
  "templateDashboards": [
    {
      "name": "string",
      "isDefault": true,
      "machineryUID": "string",
      "timestamp": 0,
      "numSensorsMonitored": 0,
      "numWidgets": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
templateDashboards [object] false none none
» name string false none none
» isDefault boolean false none none
» machineryUID string false none none
» timestamp number false none none
» numSensorsMonitored number false none none
» numWidgets number false none none

User

{
  "id": 0,
  "email": "string",
  "name": "string",
  "surname": "string",
  "roles": [
    "string"
  ],
  "active": true,
  "companyID": 0,
  "createdAt": 0,
  "createdBy": "string"
}

Properties

Name Type Required Restrictions Description
id number false none none
email string false none none
name string false none none
surname string false none none
roles [string] false none none
active boolean false none none
companyID number¦null false none none
createdAt number false none none
createdBy string false none none

CompanyUsers

[
  {
    "id": 0,
    "email": "string",
    "name": "string",
    "surname": "string",
    "roles": [
      "string"
    ],
    "active": true,
    "companyID": 0,
    "createdAt": 0,
    "createdBy": "string"
  }
]

Properties

Name Type Required Restrictions Description
anonymous [User] false none none

UpdateAccountRequest

{
  "id": 0,
  "email": "string",
  "name": "string",
  "surname": "string",
  "roles": "string",
  "active": true
}

Properties

Name Type Required Restrictions Description
id number false none none
email string false none none
name string false none none
surname string false none none
roles string false none none
active boolean false none none

PasswordResetRequest

{
  "id": 0,
  "password": "string"
}

Properties

Name Type Required Restrictions Description
id number false none none
password string false none none

CreateAccountRequest

{
  "email": "string",
  "password": "string",
  "name": "string",
  "surname": "string",
  "roles": [
    "string"
  ],
  "companyID": 0,
  "permissions": {
    "machineryUID": {
      "dashboardsWrite": true,
      "dashboardsModify": true,
      "dashboardsRead": true,
      "documentsWrite": true,
      "documentsModify": true,
      "documentsRead": true
    }
  }
}

Properties

Name Type Required Restrictions Description
email string false none none
password string false none none
name string false none none
surname string false none none
roles [string] false none none
companyID number¦null false none none
permissions object false none none
» machineryUID object false none none
»» dashboardsWrite boolean false none none
»» dashboardsModify boolean false none none
»» dashboardsRead boolean false none none
»» documentsWrite boolean false none none
»» documentsModify boolean false none none
»» documentsRead boolean false none none

UserPermissionsRequest

{
  "userID": 0,
  "machineryUID": "string",
  "dashboardsWrite": true,
  "dashboardsModify": true,
  "dashboardsRead": true,
  "documentsWrite": true,
  "documentsModify": true,
  "documentsRead": true
}

Properties

Name Type Required Restrictions Description
userID number false none none
machineryUID string false none none
dashboardsWrite boolean false none none
dashboardsModify boolean false none none
dashboardsRead boolean false none none
documentsWrite boolean false none none
documentsModify boolean false none none
documentsRead boolean false none none

UserPermissionsResponse

{
  "userID": 0,
  "machineryUID": "string",
  "dashboardsWrite": true,
  "dashboardsModify": true,
  "dashboardsRead": true,
  "documentsWrite": true,
  "documentsModify": true,
  "documentsRead": true
}

Properties

Name Type Required Restrictions Description
userID number false none none
machineryUID string false none none
dashboardsWrite boolean false none none
dashboardsModify boolean false none none
dashboardsRead boolean false none none
documentsWrite boolean false none none
documentsModify boolean false none none
documentsRead boolean false none none

AllUserPemissionsResponse

[
  {
    "userID": 0,
    "machineryUID": "string",
    "dashboardsWrite": true,
    "dashboardsModify": true,
    "dashboardsRead": true,
    "documentsWrite": true,
    "documentsModify": true,
    "documentsRead": true
  }
]

Properties

Name Type Required Restrictions Description
anonymous [UserPermissionsResponse] false none none