Skip to content

Epic(31382): Datahub maintenance #986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 83 additions & 1 deletion ext/hivemq-edge-openapi-2025.9-SNAPSHOT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ info:
## OpenAPI
HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages.
title: HiveMQ Edge REST API
version: 2025.4-SNAPSHOT
version: 2025.9-SNAPSHOT
x-logo:
url: https://www.hivemq.com/img/svg/hivemq-bee.svg
tags:
Expand Down Expand Up @@ -1541,6 +1541,7 @@ paths:
- Data Hub - FSM
/api/v1/data-hub/functions:
get:
deprecated: true
description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub. The information is provided in form of a Json Schema.
operationId: getFunctions
responses:
Expand Down Expand Up @@ -1700,6 +1701,26 @@ paths:
summary: Get all functions as a JSON Schema
tags:
- Data Hub - Functions
/api/v1/data-hub/function-specs:
get:
description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub.
operationId: getFunctionSpecs
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/FunctionSpecsList'
description: Success
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
description: Internal server error
summary: Get all functions as a list of function specifications
tags:
- Data Hub - Functions
/api/v1/data-hub/schemas:
get:
description: |-
Expand Down Expand Up @@ -4748,6 +4769,67 @@ components:
$ref: '#/components/schemas/DataPolicy'
Errors:
type: object
BehaviorPolicyTransitionEvent:
type: string
description: Accepted event in transition
enum:
- Event.OnAny
- Connection.OnDisconnect
- Mqtt.OnInboundConnect
- Mqtt.OnInboundDisconnect
- Mqtt.OnInboundPublish
- Mqtt.OnInboundSubscribe
FunctionMetadata:
description: Metadata for operation functions
type: object
properties:
isTerminal:
type: boolean
description: The function is a terminal element of a pipeline
isDataOnly:
type: boolean
description: The function is only available for Data Policies
hasArguments:
type: boolean
description: The function has extra arguments
inLicenseAllowed:
type: boolean
description: The function can be used with the current user's license
supportedEvents:
type: array
items:
$ref: '#/components/schemas/BehaviorPolicyTransitionEvent'
FunctionSpecs:
description: The configuration of a DataHub operation function
type: object
properties:
functionId:
type: string
description: The unique name of the function
metadata:
$ref: '#/components/schemas/FunctionMetadata'
description: The metadata associated with the function
schema:
$ref: '#/components/schemas/JsonNode'
description: the full JSON-Schema describimng the function and its arguments
uiSchema:
$ref: '#/components/schemas/JsonNode'
description: An optional UI Schema to customise the rendering of the configuraton form
required:
- functionId
- metadata
- schema
FunctionSpecsList:
type: object
description: List of function configurations
properties:
items:
type: array
description: List of function configurations
items:
$ref: '#/components/schemas/FunctionSpecs'
required:
- items
PolicySchema:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: string
description: Accepted event in transition
enum:
- Event.OnAny
- Connection.OnDisconnect
- Mqtt.OnInboundConnect
- Mqtt.OnInboundDisconnect
- Mqtt.OnInboundPublish
- Mqtt.OnInboundSubscribe
21 changes: 21 additions & 0 deletions ext/openAPI/components/schemas/FunctionMetadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
description: Metadata for operation functions
type: object
properties:
isTerminal:
type: boolean
description: The function is a terminal element of a pipeline
isDataOnly:
type: boolean
description: The function is only available for Data Policies
hasArguments:
type: boolean
description: The function has extra arguments
inLicenseAllowed:
type: boolean
description: The function can be used with the current user's license
supportedEvents:
type: array
items:
$ref: ./BehaviorPolicyTransitionEvent.yaml


19 changes: 19 additions & 0 deletions ext/openAPI/components/schemas/FunctionSpecs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description: The configuration of a DataHub operation function
type: object
properties:
functionId:
type: string
description: The unique name of the function
metadata:
$ref: ./FunctionMetadata.yaml
description: The metadata associated with the function
schema:
$ref: ./JsonNode.yaml
description: the full JSON-Schema describimng the function and its arguments
uiSchema:
$ref: ./JsonNode.yaml
description: An optional UI Schema to customise the rendering of the configuraton form
required:
- functionId
- metadata
- schema
10 changes: 10 additions & 0 deletions ext/openAPI/components/schemas/FunctionSpecsList.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
description: List of function configurations
properties:
items:
type: array
description: List of function configurations
items:
$ref: ./FunctionSpecs.yaml
required:
- items
4 changes: 3 additions & 1 deletion ext/openAPI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ info:
imported into popular API tooling (e.g. Postman) or can be used to generate
client-code for multiple programming languages.
title: HiveMQ Edge REST API
version: 2025.4-SNAPSHOT
version: 2025.9-SNAPSHOT
x-logo:
url: https://www.hivemq.com/img/svg/hivemq-bee.svg
tags:
Expand Down Expand Up @@ -176,6 +176,8 @@ paths:
$ref: paths/api_v1_data-hub_fsm.yaml
/api/v1/data-hub/functions:
$ref: paths/api_v1_data-hub_functions.yaml
/api/v1/data-hub/function-specs:
$ref: paths/api_v1_data-hub_function-specs.yaml
/api/v1/data-hub/schemas:
$ref: paths/api_v1_data-hub_schemas.yaml
/api/v1/data-hub/schemas/{schemaId}:
Expand Down
21 changes: 21 additions & 0 deletions ext/openAPI/paths/api_v1_data-hub_function-specs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
get:
description: >-
This endpoints provides the means to get information on the available
Functions for the HiveMQ Data Hub.
operationId: getFunctionSpecs
responses:
'200':
content:
application/json:
schema:
$ref: ../components/schemas/FunctionSpecsList.yaml
description: Success
'500':
content:
application/json:
schema:
$ref: ../components/schemas/ProblemDetails.yaml
description: Internal server error
summary: Get all functions as a list of function specifications
tags:
- Data Hub - Functions
1 change: 1 addition & 0 deletions ext/openAPI/paths/api_v1_data-hub_functions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
get:
deprecated: true
description: >-
This endpoints provides the means to get information on the available
Functions for the HiveMQ Data Hub. The information is provided in form of a
Expand Down
3 changes: 2 additions & 1 deletion hivemq-edge-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build:tsc": "tsc -b",
"lint:eslint": "eslint src --report-unused-disable-directives --max-warnings 0",
"lint:eslint:fix": "eslint src --report-unused-disable-directives --max-warnings 0 --fix",
"lint:prettier": "prettier --check .",
"lint:prettier:write": "prettier --write .",
"lint:stylelint": "stylelint './src/**/*.css'",
"lint:all": "eslint src --report-unused-disable-directives --max-warnings 0 && prettier --check .",
"dev:openAPI": "openapi --input '../../../../hivemq-edge/ext/hivemq-edge-openapi-2025.8-SNAPSHOT.yaml' -o ./src/api/__generated__ -c axios --name HiveMqClient --exportSchemas true",
"dev:openAPI": "openapi --input '../ext/hivemq-edge-openapi-2025.9-SNAPSHOT.yaml' -o ./src/api/__generated__ -c axios --name HiveMqClient --exportSchemas true",
"dev:chakra:types": "chakra-cli tokens './src/modules/Theme/themeHiveMQ.ts' --out 'node_modules/.pnpm/@[email protected]/node_modules/@chakra-ui/styled-system/dist/theming.types.d.ts'",
"cypress:open": "cypress open",
"cypress:open:component": "cypress open --component --browser chrome",
Expand Down
8 changes: 4 additions & 4 deletions hivemq-edge-frontend/src/__test-utils__/msw/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import { handlers as DataHubDataPoliciesService } from '@/extensions/datahub/api
import { handlers as DataHubBehaviorPoliciesService } from '@/extensions/datahub/api/hooks/DataHubBehaviorPoliciesService/__handlers__'
import { handlers as DataHubSchemasService } from '@/extensions/datahub/api/hooks/DataHubSchemasService/__handlers__'
import { handlers as DataHubScriptsService } from '@/extensions/datahub/api/hooks/DataHubScriptsService/__handlers__'
import { handlers as combinerHandlers } from '@/api/hooks/useCombiners/__handlers__'
import { handlersWithoutLicense as DataHubFunctionsService } from '@/extensions/datahub/api/hooks/DataHubFunctionsService/__handlers__'

import { safeTopicSchemaHandlers } from '@/api/hooks/useDomainModel/__handlers__'
import type { MQTTSample } from '@/hooks/usePrivateMqttClient/type.ts'

export const handlers = [
Expand All @@ -33,12 +32,13 @@ export const createHandlersWithMQTTClient = (
_onSampling?: (topicFilter: string) => Promise<MQTTSample[]> | undefined
) => {
return [
...combinerHandlers,
...DataHubFunctionsService,
// ...combinerHandlers,
// ...DeviceHandlers,
// ...TopicFilterHandlers,
// Domain & Schemas
// ...schemaHandlers(onSampling),
...safeTopicSchemaHandlers,
// ...safeTopicSchemaHandlers,
// ...safeWritingSchemaHandlers,
]
}
2 changes: 1 addition & 1 deletion hivemq-edge-frontend/src/api/__generated__/HiveMqClient.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hivemq-edge-frontend/src/api/__generated__/core/OpenAPI.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions hivemq-edge-frontend/src/api/__generated__/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions hivemq-edge-frontend/src/api/__generated__/models/FunctionSpecs.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading