openapi: 3.0.0 info: title: API Documentation version: 1.0.0 description: API documentation for Devices, Nodes, Pipelines, Links, DataPoints, and Notifications servers: - url: 'http://localhost:3000' paths: /api/devices: get: summary: Retrieve all devices tags: - Devices responses: '200': description: Successfully retrieved list of devices content: application/json: schema: type: array items: $ref: '#/components/schemas/Device' post: summary: Create a new device tags: - Devices requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateDevice' responses: '201': description: Device successfully created content: application/json: schema: $ref: '#/components/schemas/Device' /api/devices/{id}: get: summary: Get a device by ID tags: - Devices parameters: - in: path name: id required: true schema: type: integer description: The device ID responses: '200': description: Successfully retrieved the device content: application/json: schema: $ref: '#/components/schemas/Device' '404': description: Device not found delete: summary: Delete a device by ID tags: - Devices parameters: - in: path name: id required: true schema: type: integer description: The device ID responses: '204': description: Device successfully deleted /api/nodes: get: summary: Retrieve all nodes tags: - Nodes responses: '200': description: Successfully retrieved list of nodes content: application/json: schema: type: array items: $ref: '#/components/schemas/Node' post: summary: Create a new node tags: - Nodes requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateNode' responses: '201': description: Node successfully created content: application/json: schema: $ref: '#/components/schemas/Node' /api/nodes/{id}: get: summary: Get a node by ID tags: - Nodes parameters: - in: path name: id required: true schema: type: integer description: The node ID responses: '200': description: Successfully retrieved the node content: application/json: schema: $ref: '#/components/schemas/Node' '404': description: Node not found delete: summary: Delete a node by ID tags: - Nodes parameters: - in: path name: id required: true schema: type: integer description: The node ID responses: '204': description: Node successfully deleted /api/pipelines: get: summary: Retrieve all pipelines tags: - Pipelines responses: '200': description: Successfully retrieved list of pipelines content: application/json: schema: type: array items: $ref: '#/components/schemas/Pipeline' post: summary: Create a new pipeline tags: - Pipelines requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreatePipeline' responses: '201': description: Pipeline successfully created content: application/json: schema: $ref: '#/components/schemas/Pipeline' /api/pipelines/{id}: get: summary: Get a pipeline by ID tags: - Pipelines parameters: - in: path name: id required: true schema: type: integer description: The pipeline ID responses: '200': description: Successfully retrieved the pipeline content: application/json: schema: $ref: '#/components/schemas/Pipeline' '404': description: Pipeline not found delete: summary: Delete a pipeline by ID tags: - Pipelines parameters: - in: path name: id required: true schema: type: integer description: The pipeline ID responses: '204': description: Pipeline successfully deleted /api/links: get: summary: Retrieve all links tags: - Links responses: '200': description: Successfully retrieved list of links content: application/json: schema: type: array items: $ref: '#/components/schemas/Link' post: summary: Create a new link tags: - Links requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateLink' responses: '201': description: Link successfully created content: application/json: schema: $ref: '#/components/schemas/Link' /api/datapoints: get: summary: Retrieve all data points tags: - DataPoints responses: '200': description: Successfully retrieved list of data points content: application/json: schema: type: array items: $ref: '#/components/schemas/DataPoint' post: summary: Create a new data point tags: - DataPoints requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateDataPoint' responses: '201': description: Data point successfully created content: application/json: schema: $ref: '#/components/schemas/DataPoint' /api/notifications: get: summary: Retrieve all notifications tags: - Notifications responses: '200': description: Successfully retrieved list of notifications content: application/json: schema: type: array items: $ref: '#/components/schemas/Notification' post: summary: Create a new notification tags: - Notifications requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateNotification' responses: '201': description: Notification successfully created content: application/json: schema: $ref: '#/components/schemas/Notification' components: schemas: Device: type: object properties: id: type: integer name: type: string status: type: boolean description: Device status (online/offline) example: id: 1 name: Device A status: true CreateDevice: type: object properties: name: type: string description: Device name status: type: boolean description: Initial status of the device example: name: New Device status: true Node: type: object properties: id: type: integer name: type: string type: type: string description: Node type (input/output/default) position: type: object properties: x: type: number y: type: number pipelineId: type: integer example: id: 1 name: Node A type: input position: x: 100 y: 200 pipelineId: 1 CreateNode: type: object properties: name: type: string type: type: string description: Type of the node (input/output/default) position: type: object properties: x: type: number y: type: number pipelineId: type: integer example: name: New Node type: default position: x: 100 y: 200 pipelineId: 1 Pipeline: type: object properties: id: type: integer name: type: string description: type: string deviceId: type: integer example: id: 1 name: Pipeline 1 description: Example pipeline deviceId: 1 CreatePipeline: type: object properties: name: type: string description: type: string deviceId: type: integer example: name: New Pipeline description: Description of new pipeline deviceId: 1 Link: type: object properties: id: type: integer sourceNodeId: type: integer targetNodeId: type: integer createdAt: type: string format: date-time example: id: 1 sourceNodeId: 1 targetNodeId: 2 createdAt: '2024-09-25T10:00:00Z' CreateLink: type: object properties: sourceNodeId: type: integer targetNodeId: type: integer example: sourceNodeId: 1 targetNodeId: 2 DataPoint: type: object properties: id: type: integer value: type: number timestamp: type: string format: date-time nodeId: type: integer deviceId: type: integer example: id: 1 value: 57.5 timestamp: '2024-09-25T12:00:00Z' nodeId: 1 deviceId: 1 CreateDataPoint: type: object properties: value: type: number nodeId: type: integer deviceId: type: integer example: value: 57.5 nodeId: 1 deviceId: 1 Notification: type: object properties: id: type: integer message: type: string nodeId: type: integer createdAt: type: string format: date-time example: id: 1 message: 'Node A is down' nodeId: 1 createdAt: '2024-09-25T12:00:00Z' CreateNotification: type: object properties: message: type: string nodeId: type: integer example: message: 'Node A is down' nodeId: 1