Skip to content

Commit c4a3cb2

Browse files
authored
Merge pull request #995
* refactor(29945): remove deprecated store-based list of functions * refactor(29945): refactor the react-query hook * refactor(29945): update openAPI specs * refactor(29945): update mocks for functions * refactor(29945): fix mocks * test(29945): add tests * refactor(29945): update openAPI specs * refactor(29945): fix dataOnly for mocks * refactor(29945): add license-free mocks * feat(29945): add filtering hook for functions * test(29945): add tests * refactor(29945): fix default MSW handlers * refactor(29945): refactor the JSONSchema for operation as a template * refactor(29945): Add the DataHub.transform function to the list * refactor(29945): add functions to the selector * refactor(29945): add functions to the editor * refactor(29945): add functions to the form context * refactor(29945): get context of the pipeline * refactor(29945): replace deprecated type * refactor(29945): linting * test(29945): fix tests * test(29945): fix tests * test(29945): add tests * test(29945): add tests * fix(29945): fix tsc errors * chore(29945): fix scripts * chore(29945): fix translations * test(29945): fix tests * test(29945): fix tests * test(29945): fix tests * test(29945): fix tests * chore(29945): revert fix
1 parent 69ea90d commit c4a3cb2

File tree

54 files changed

+1248
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1248
-418
lines changed

ext/hivemq-edge-openapi-2025.9-SNAPSHOT.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ paths:
15411541
- Data Hub - FSM
15421542
/api/v1/data-hub/functions:
15431543
get:
1544+
deprecated: true
15441545
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.
15451546
operationId: getFunctions
15461547
responses:
@@ -1700,6 +1701,26 @@ paths:
17001701
summary: Get all functions as a JSON Schema
17011702
tags:
17021703
- Data Hub - Functions
1704+
/api/v1/data-hub/function-specs:
1705+
get:
1706+
description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub.
1707+
operationId: getFunctionSpecs
1708+
responses:
1709+
'200':
1710+
content:
1711+
application/json:
1712+
schema:
1713+
$ref: '#/components/schemas/FunctionSpecsList'
1714+
description: Success
1715+
'500':
1716+
content:
1717+
application/json:
1718+
schema:
1719+
$ref: '#/components/schemas/ProblemDetails'
1720+
description: Internal server error
1721+
summary: Get all functions as a list of function specifications
1722+
tags:
1723+
- Data Hub - Functions
17031724
/api/v1/data-hub/schemas:
17041725
get:
17051726
description: |-
@@ -4748,6 +4769,67 @@ components:
47484769
$ref: '#/components/schemas/DataPolicy'
47494770
Errors:
47504771
type: object
4772+
BehaviorPolicyTransitionEvent:
4773+
type: string
4774+
description: Accepted event in transition
4775+
enum:
4776+
- Event.OnAny
4777+
- Connection.OnDisconnect
4778+
- Mqtt.OnInboundConnect
4779+
- Mqtt.OnInboundDisconnect
4780+
- Mqtt.OnInboundPublish
4781+
- Mqtt.OnInboundSubscribe
4782+
FunctionMetadata:
4783+
description: Metadata for operation functions
4784+
type: object
4785+
properties:
4786+
isTerminal:
4787+
type: boolean
4788+
description: The function is a terminal element of a pipeline
4789+
isDataOnly:
4790+
type: boolean
4791+
description: The function is only available for Data Policies
4792+
hasArguments:
4793+
type: boolean
4794+
description: The function has extra arguments
4795+
inLicenseAllowed:
4796+
type: boolean
4797+
description: The function can be used with the current user's license
4798+
supportedEvents:
4799+
type: array
4800+
items:
4801+
$ref: '#/components/schemas/BehaviorPolicyTransitionEvent'
4802+
FunctionSpecs:
4803+
description: The configuration of a DataHub operation function
4804+
type: object
4805+
properties:
4806+
functionId:
4807+
type: string
4808+
description: The unique name of the function
4809+
metadata:
4810+
$ref: '#/components/schemas/FunctionMetadata'
4811+
description: The metadata associated with the function
4812+
schema:
4813+
$ref: '#/components/schemas/JsonNode'
4814+
description: the full JSON-Schema describimng the function and its arguments
4815+
uiSchema:
4816+
$ref: '#/components/schemas/JsonNode'
4817+
description: An optional UI Schema to customise the rendering of the configuraton form
4818+
required:
4819+
- functionId
4820+
- metadata
4821+
- schema
4822+
FunctionSpecsList:
4823+
type: object
4824+
description: List of function configurations
4825+
properties:
4826+
items:
4827+
type: array
4828+
description: List of function configurations
4829+
items:
4830+
$ref: '#/components/schemas/FunctionSpecs'
4831+
required:
4832+
- items
47514833
PolicySchema:
47524834
type: object
47534835
properties:

hivemq-edge-frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc && vite build",
9+
"build:tsc": "tsc -b",
910
"lint:eslint": "eslint src --report-unused-disable-directives --max-warnings 0",
1011
"lint:eslint:fix": "eslint src --report-unused-disable-directives --max-warnings 0 --fix",
1112
"lint:prettier": "prettier --check .",
1213
"lint:prettier:write": "prettier --write .",
1314
"lint:stylelint": "stylelint './src/**/*.css'",
1415
"lint:all": "eslint src --report-unused-disable-directives --max-warnings 0 && prettier --check .",
15-
"dev:openAPI": "openapi --input '../../../../hivemq-edge/ext/hivemq-edge-openapi-2025.8-SNAPSHOT.yaml' -o ./src/api/__generated__ -c axios --name HiveMqClient --exportSchemas true",
16+
"dev:openAPI": "openapi --input '../ext/hivemq-edge-openapi-2025.9-SNAPSHOT.yaml' -o ./src/api/__generated__ -c axios --name HiveMqClient --exportSchemas true",
1617
"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'",
1718
"cypress:open": "cypress open",
1819
"cypress:open:component": "cypress open --component --browser chrome",

hivemq-edge-frontend/src/__test-utils__/msw/handlers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import { handlers as DataHubDataPoliciesService } from '@/extensions/datahub/api
99
import { handlers as DataHubBehaviorPoliciesService } from '@/extensions/datahub/api/hooks/DataHubBehaviorPoliciesService/__handlers__'
1010
import { handlers as DataHubSchemasService } from '@/extensions/datahub/api/hooks/DataHubSchemasService/__handlers__'
1111
import { handlers as DataHubScriptsService } from '@/extensions/datahub/api/hooks/DataHubScriptsService/__handlers__'
12-
import { handlers as combinerHandlers } from '@/api/hooks/useCombiners/__handlers__'
12+
import { handlersWithoutLicense as DataHubFunctionsService } from '@/extensions/datahub/api/hooks/DataHubFunctionsService/__handlers__'
1313

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

1716
export const handlers = [
@@ -33,12 +32,13 @@ export const createHandlersWithMQTTClient = (
3332
_onSampling?: (topicFilter: string) => Promise<MQTTSample[]> | undefined
3433
) => {
3534
return [
36-
...combinerHandlers,
35+
...DataHubFunctionsService,
36+
// ...combinerHandlers,
3737
// ...DeviceHandlers,
3838
// ...TopicFilterHandlers,
3939
// Domain & Schemas
4040
// ...schemaHandlers(onSampling),
41-
...safeTopicSchemaHandlers,
41+
// ...safeTopicSchemaHandlers,
4242
// ...safeWritingSchemaHandlers,
4343
]
4444
}

hivemq-edge-frontend/src/api/__generated__/HiveMqClient.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hivemq-edge-frontend/src/api/__generated__/core/OpenAPI.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hivemq-edge-frontend/src/api/__generated__/index.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hivemq-edge-frontend/src/api/__generated__/models/BehaviorPolicyTransitionEvent.ts

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hivemq-edge-frontend/src/api/__generated__/models/FunctionMetadata.ts

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hivemq-edge-frontend/src/api/__generated__/models/FunctionSpecs.ts

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hivemq-edge-frontend/src/api/__generated__/models/FunctionSpecsList.ts

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)