diff --git a/modules_metadata/__init__.py b/modules_metadata/__init__.py index dac75a6..f7916d6 100644 --- a/modules_metadata/__init__.py +++ b/modules_metadata/__init__.py @@ -18,4 +18,4 @@ Modules metadata loader and validator and sets of useful enums """ -__version__ = "0.20.1" +__version__ = "0.21.0" diff --git a/modules_metadata/devices_module.py b/modules_metadata/devices_module.py index 55ea045..00e80a4 100644 --- a/modules_metadata/devices_module.py +++ b/modules_metadata/devices_module.py @@ -44,6 +44,38 @@ class ConnectorType(ExtendedEnum): MODBUS: str = "modbus" +@unique +class DeviceType(ExtendedEnum): + """ + Device type + + @package FastyBird:ModulesMetadata! + @module devices_module + + @author Adam Kadlec + """ + + LOCAL: str = "local" + NETWORK: str = "network" + VIRTUAL: str = "virtual" + HOMEKIT: str = "homekit" + + +@unique +class PropertyType(ExtendedEnum): + """ + Property entity type + + @package FastyBird:ModulesMetadata! + @module devices_module + + @author Adam Kadlec + """ + + DYNAMIC: str = "dynamic" + STATIC: str = "static" + + @unique class DeviceConnectionState(ExtendedEnum): """ @@ -78,9 +110,9 @@ class DeviceConnectionState(ExtendedEnum): @unique -class DeviceType(ExtendedEnum): +class ConfigurationField(ExtendedEnum): """ - Device type + Configuration fields types @package FastyBird:ModulesMetadata! @module devices_module @@ -88,16 +120,16 @@ class DeviceType(ExtendedEnum): @author Adam Kadlec """ - LOCAL: str = "local" - NETWORK: str = "network" - VIRTUAL: str = "virtual" - HOMEKIT: str = "homekit" + BOOLEAN: str = "boolean" + NUMBER: str = "number" + SELECT: str = "select" + TEXT: str = "text" @unique -class HardwareManufacturer(ExtendedEnum): +class ConfigurationBooleanFieldAttribute(ExtendedEnum): """ - Device hardware manufacturer + Configuration boolean field attributes @package FastyBird:ModulesMetadata! @module devices_module @@ -105,13 +137,53 @@ class HardwareManufacturer(ExtendedEnum): @author Adam Kadlec """ - GENERIC = "generic" - FASTYBIRD = "fastybird" - ITEAD = "itead" - AI_THINKER = "ai_thinker" - SHELLY: str = "shelly" - TUYA: str = "tuya" - SONOFF: str = "sonoff" + DEFAULT: str = "default" + + +@unique +class ConfigurationNumberFieldAttribute(ExtendedEnum): + """ + Configuration number field attributes + + @package FastyBird:ModulesMetadata! + @module devices_module + + @author Adam Kadlec + """ + + MIN: str = "min" + MAX: str = "max" + STEP: str = "step" + DEFAULT: str = "default" + + +@unique +class ConfigurationSelectFieldAttribute(ExtendedEnum): + """ + Configuration select field attributes + + @package FastyBird:ModulesMetadata! + @module devices_module + + @author Adam Kadlec + """ + + VALUES: str = "values" + DEFAULT: str = "default" + + +@unique +class ConfigurationTextFieldAttribute(ExtendedEnum): + """ + Configuration text field attributes + + @package FastyBird:ModulesMetadata! + @module devices_module + + @author Adam Kadlec + """ + + DEFAULT: str = "default" @unique @@ -177,6 +249,26 @@ class FirmwareManufacturer(ExtendedEnum): SONOFF: str = "sonoff" +@unique +class HardwareManufacturer(ExtendedEnum): + """ + Device hardware manufacturer + + @package FastyBird:ModulesMetadata! + @module devices_module + + @author Adam Kadlec + """ + + GENERIC = "generic" + FASTYBIRD = "fastybird" + ITEAD = "itead" + AI_THINKER = "ai_thinker" + SHELLY: str = "shelly" + TUYA: str = "tuya" + SONOFF: str = "sonoff" + + @unique class DevicePropertyName(ExtendedEnum): """ @@ -199,95 +291,3 @@ class DevicePropertyName(ExtendedEnum): IP_ADDRESS: str = "ip-address" STATUS_LED: str = "status-led" FREE_HEAP: str = "free-heap" - - -@unique -class ConfigurationField(ExtendedEnum): - """ - Configuration fields types - - @package FastyBird:ModulesMetadata! - @module devices_module - - @author Adam Kadlec - """ - - BOOLEAN: str = "boolean" - NUMBER: str = "number" - SELECT: str = "select" - TEXT: str = "text" - - -@unique -class ConfigurationNumberFieldAttribute(ExtendedEnum): - """ - Configuration number field attributes - - @package FastyBird:ModulesMetadata! - @module devices_module - - @author Adam Kadlec - """ - - MIN: str = "min" - MAX: str = "max" - STEP: str = "step" - DEFAULT: str = "default" - - -@unique -class ConfigurationTextFieldAttribute(ExtendedEnum): - """ - Configuration text field attributes - - @package FastyBird:ModulesMetadata! - @module devices_module - - @author Adam Kadlec - """ - - DEFAULT: str = "default" - - -@unique -class ConfigurationBooleanFieldAttribute(ExtendedEnum): - """ - Configuration boolean field attributes - - @package FastyBird:ModulesMetadata! - @module devices_module - - @author Adam Kadlec - """ - - DEFAULT: str = "default" - - -@unique -class ConfigurationSelectFieldAttribute(ExtendedEnum): - """ - Configuration select field attributes - - @package FastyBird:ModulesMetadata! - @module devices_module - - @author Adam Kadlec - """ - - VALUES: str = "values" - DEFAULT: str = "default" - - -@unique -class PropertyType(ExtendedEnum): - """ - Property entity type - - @package FastyBird:ModulesMetadata! - @module devices_module - - @author Adam Kadlec - """ - - DYNAMIC: str = "dynamic" - STATIC: str = "static" diff --git a/modules_metadata/helpers.py b/modules_metadata/helpers.py index 612f06b..50df6bb 100644 --- a/modules_metadata/helpers.py +++ b/modules_metadata/helpers.py @@ -49,149 +49,136 @@ def filter_enum_format( return str(value).lower() == item -class ValueHelper: # pylint: disable=too-few-public-methods - """ - Item value helpers - - @package FastyBird:ModulesMetadata! - @module helpers - - @author Adam Kadlec - """ - - @staticmethod - def normalize_value( # pylint: disable=too-many-return-statements,too-many-branches - data_type: DataType, - value: Union[int, float, str, bool, datetime, ButtonPayload, SwitchPayload, None], - value_format: Union[ - Tuple[Optional[int], Optional[int]], - Tuple[Optional[float], Optional[float]], - List[Union[str, Tuple[str, Optional[str], Optional[str]]]], - None, - ] = None, - ) -> Union[int, float, str, bool, datetime, ButtonPayload, SwitchPayload, None]: - """Normalize property value based od property data type""" - if value is None: - return value +def normalize_value( # pylint: disable=too-many-return-statements,too-many-branches + data_type: DataType, + value: Union[int, float, str, bool, datetime, ButtonPayload, SwitchPayload, None], + value_format: Union[ + Tuple[Optional[int], Optional[int]], + Tuple[Optional[float], Optional[float]], + List[Union[str, Tuple[str, Optional[str], Optional[str]]]], + None, + ] = None, +) -> Union[int, float, str, bool, datetime, ButtonPayload, SwitchPayload, None]: + """Normalize value based on data type & value format""" + if value is None: + return value - if data_type in ( - DataType.CHAR, - DataType.UCHAR, - DataType.SHORT, - DataType.USHORT, - DataType.INT, - DataType.UINT, - ): - try: - int_value: int = ( - value - if isinstance(value, int) - else fast_int(str(value), raise_on_invalid=True) # type: ignore[arg-type] - ) - - except ValueError: - return None + if data_type in ( + DataType.CHAR, + DataType.UCHAR, + DataType.SHORT, + DataType.USHORT, + DataType.INT, + DataType.UINT, + ): + try: + int_value: int = ( + value + if isinstance(value, int) + else fast_int(str(value), raise_on_invalid=True) # type: ignore[arg-type] + ) + + except ValueError: + return None - if value_format is not None and isinstance(value_format, tuple) and len(value_format) == 2: - min_value, max_value = value_format + if value_format is not None and isinstance(value_format, tuple) and len(value_format) == 2: + min_value, max_value = value_format - if min_value is not None and isinstance(min_value, (int, float)) and min_value > int_value: - return None + if min_value is not None and isinstance(min_value, (int, float)) and min_value > int_value: + return None - if max_value is not None and isinstance(max_value, (int, float)) and max_value < int_value: - return None + if max_value is not None and isinstance(max_value, (int, float)) and max_value < int_value: + return None - return int_value + return int_value - if data_type == DataType.FLOAT: - try: - float_value: float = ( - value - if isinstance(value, int) - else fast_float(str(value), raise_on_invalid=True) # type: ignore[arg-type] - ) + if data_type == DataType.FLOAT: + try: + float_value: float = ( + value + if isinstance(value, int) + else fast_float(str(value), raise_on_invalid=True) # type: ignore[arg-type] + ) - except ValueError: - return None + except ValueError: + return None - if value_format is not None and isinstance(value_format, tuple) and len(value_format) == 2: - min_value, max_value = value_format + if value_format is not None and isinstance(value_format, tuple) and len(value_format) == 2: + min_value, max_value = value_format - if min_value is not None and isinstance(min_value, (int, float)) and min_value > float_value: - return None + if min_value is not None and isinstance(min_value, (int, float)) and min_value > float_value: + return None - if max_value is not None and isinstance(max_value, (int, float)) and max_value < float_value: - return None + if max_value is not None and isinstance(max_value, (int, float)) and max_value < float_value: + return None - return float_value + return float_value - if data_type == DataType.BOOLEAN: - if isinstance(value, bool): - return value + if data_type == DataType.BOOLEAN: + if isinstance(value, bool): + return value - value = str(value) + value = str(value) - return value.lower() in ["true", "t", "yes", "y", "1", "on"] + return value.lower() in ["true", "t", "yes", "y", "1", "on"] - if data_type == DataType.STRING: - return str(value) + if data_type == DataType.STRING: + return str(value) - if data_type == DataType.ENUM: - if value_format is not None and isinstance(value_format, list): - filtered = [item for item in value_format if filter_enum_format(item=item, value=value)] + if data_type == DataType.ENUM: + if value_format is not None and isinstance(value_format, list): + filtered = [item for item in value_format if filter_enum_format(item=item, value=value)] - return ( - (filtered[0][0] if isinstance(filtered[0], tuple) else filtered[0]) if len(filtered) == 1 else None - ) + return (filtered[0][0] if isinstance(filtered[0], tuple) else filtered[0]) if len(filtered) == 1 else None - return None + return None - if data_type == DataType.DATE: - if isinstance(value, datetime): - return value + if data_type == DataType.DATE: + if isinstance(value, datetime): + return value - try: - return datetime.strptime(str(value), "%Y-%m-%d") + try: + return datetime.strptime(str(value), "%Y-%m-%d") - except ValueError: - return None + except ValueError: + return None - if data_type == DataType.TIME: - if isinstance(value, datetime): - return value + if data_type == DataType.TIME: + if isinstance(value, datetime): + return value - try: - return datetime.strptime(str(value), "%H:%M:%S%z") + try: + return datetime.strptime(str(value), "%H:%M:%S%z") - except ValueError: - return None + except ValueError: + return None - if data_type == DataType.DATETIME: - if isinstance(value, datetime): - return value + if data_type == DataType.DATETIME: + if isinstance(value, datetime): + return value - try: - return datetime.strptime(str(value), r"%Y-%m-%d\T%H:%M:%S%z") + try: + return datetime.strptime(str(value), r"%Y-%m-%d\T%H:%M:%S%z") - except ValueError: - return None + except ValueError: + return None - if data_type == DataType.BUTTON: - if isinstance(value, ButtonPayload): - return value + if data_type == DataType.BUTTON: + if isinstance(value, ButtonPayload): + return value - if ButtonPayload.has_value(str(value)): - return ButtonPayload(str(value)) + if ButtonPayload.has_value(str(value)): + return ButtonPayload(str(value)) - return None + return None - if data_type == DataType.SWITCH: - if isinstance(value, SwitchPayload): - return value + if data_type == DataType.SWITCH: + if isinstance(value, SwitchPayload): + return value - if SwitchPayload.has_value(str(value)): - return SwitchPayload(str(value)) + if SwitchPayload.has_value(str(value)): + return SwitchPayload(str(value)) - return None + return None - return value + return value diff --git a/modules_metadata/loader.py b/modules_metadata/loader.py index 62dea79..b8fc88c 100644 --- a/modules_metadata/loader.py +++ b/modules_metadata/loader.py @@ -20,6 +20,7 @@ # Python base dependencies from io import BytesIO +from os import path from typing import Any, Dict, Optional # Library dependencies @@ -35,30 +36,25 @@ MalformedInputException, ) from modules_metadata.routing import RoutingKey -from modules_metadata.types import ModuleOrigin from modules_metadata.validator import validate -def load_schema(origin: ModuleOrigin, routing_key: RoutingKey) -> str: +def load_schema_by_namespace(namespace: str, schema_file: str) -> str: """Load JSON schema for module origin and routing key""" + schema_content = get_data_file_content( + path.dirname(("resources/schemas" + namespace + "/").replace("/", path.sep)) + path.sep + schema_file + ) - if origin.value in JSON_SCHEMAS_MAPPING: - mapping = JSON_SCHEMAS_MAPPING[origin.value] - - if routing_key.value in mapping: - schema = str(JSON_SCHEMAS_MAPPING[origin.value][routing_key.value]) - - schema_content = get_data_file_content(schema) - - if schema_content is not None: - return schema_content + if schema_content is not None: + return schema_content - raise FileNotFoundException("Schema could not be loaded") + raise FileNotFoundException("Schema could not be loaded") - no_modules_routes = JSON_SCHEMAS_MAPPING[ModuleOrigin(ModuleOrigin.NOT_SPECIFIED).value] - if routing_key.value in no_modules_routes: - schema = str(no_modules_routes[routing_key.value]) +def load_schema_by_routing_key(routing_key: RoutingKey) -> str: + """Load JSON schema for routing key""" + if routing_key.value in JSON_SCHEMAS_MAPPING: + schema = str(JSON_SCHEMAS_MAPPING[routing_key.value]) schema_content = get_data_file_content(schema) @@ -68,13 +64,12 @@ def load_schema(origin: ModuleOrigin, routing_key: RoutingKey) -> str: raise FileNotFoundException("Schema could not be loaded") raise InvalidArgumentException( - f"Schema for origin: {origin.value} and routing key: {routing_key.value} is not configured", + f"Schema for routing key: {routing_key.value} is not configured", ) def load_metadata() -> Dict[str, Any]: """Load modules metadata""" - schema_content = get_data_file_content("resources/schemas/modules.json") if schema_content is None: @@ -96,7 +91,6 @@ def load_metadata() -> Dict[str, Any]: def get_data_file_content(filename: str) -> Optional[str]: """Load file content from package resources""" - try: return BytesIO(resource_string(__name__, filename)).read().decode() @@ -105,161 +99,176 @@ def get_data_file_content(filename: str) -> Optional[str]: JSON_SCHEMAS_MAPPING = { - ModuleOrigin(ModuleOrigin.NOT_SPECIFIED).value: { - RoutingKey(RoutingKey.DEVICES_PROPERTIES_DATA).value: "resources/schemas/data/data.device.property.json", - RoutingKey( - RoutingKey.DEVICES_CONFIGURATION_DATA - ).value: "resources/schemas/data/data.device.configuration.json", - RoutingKey(RoutingKey.DEVICES_CONTROL_ENTITY_DATA).value: "resources/schemas/data/data.device.control.json", - RoutingKey(RoutingKey.CHANNELS_PROPERTIES_DATA).value: "resources/schemas/data/data.channel.property.json", - RoutingKey( - RoutingKey.CHANNELS_CONFIGURATION_DATA - ).value: "resources/schemas/data/data.channel.configuration.json", - RoutingKey(RoutingKey.CHANNELS_CONTROL_ENTITY_DATA).value: "resources/schemas/data/data.channel.control.json", - RoutingKey( - RoutingKey.CONNECTORS_CONTROL_ENTITY_DATA - ).value: "resources/schemas/data/data.connector.control.json", - RoutingKey(RoutingKey.TRIGGERS_CONTROL_ENTITY_DATA).value: "resources/schemas/data/data.trigger.control.json", - }, - ModuleOrigin(ModuleOrigin.ACCOUNTS_MODULE).value: { - RoutingKey(RoutingKey.ACCOUNTS_ENTITY_CREATED).value: "resources/schemas/accounts-module/entity.account.json", - RoutingKey(RoutingKey.ACCOUNTS_ENTITY_UPDATED).value: "resources/schemas/accounts-module/entity.account.json", - RoutingKey(RoutingKey.ACCOUNTS_ENTITY_DELETED).value: "resources/schemas/accounts-module/entity.account.json", - RoutingKey(RoutingKey.EMAILS_ENTITY_CREATED).value: "resources/schemas/accounts-module/entity.email.json", - RoutingKey(RoutingKey.EMAILS_ENTITY_UPDATED).value: "resources/schemas/accounts-module/entity.email.json", - RoutingKey(RoutingKey.EMAILS_ENTITY_DELETED).value: "resources/schemas/accounts-module/entity.email.json", - RoutingKey( - RoutingKey.IDENTITIES_ENTITY_CREATED - ).value: "resources/schemas/accounts-module/entity.identity.json", - RoutingKey( - RoutingKey.IDENTITIES_ENTITY_UPDATED - ).value: "resources/schemas/accounts-module/entity.identity.json", - RoutingKey( - RoutingKey.IDENTITIES_ENTITY_DELETED - ).value: "resources/schemas/accounts-module/entity.identity.json", - RoutingKey(RoutingKey.ROLES_ENTITY_CREATED).value: "resources/schemas/accounts-module/entity.role.json", - RoutingKey(RoutingKey.ROLES_ENTITY_UPDATED).value: "resources/schemas/accounts-module/entity.role.json", - RoutingKey(RoutingKey.ROLES_ENTITY_DELETED).value: "resources/schemas/accounts-module/entity.role.json", - }, - ModuleOrigin(ModuleOrigin.DEVICES_MODULE).value: { - RoutingKey(RoutingKey.DEVICES_ENTITY_CREATED).value: "resources/schemas/devices-module/entity.device.json", - RoutingKey(RoutingKey.DEVICES_ENTITY_UPDATED).value: "resources/schemas/devices-module/entity.device.json", - RoutingKey(RoutingKey.DEVICES_ENTITY_DELETED).value: "resources/schemas/devices-module/entity.device.json", - RoutingKey( - RoutingKey.DEVICES_PROPERTY_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.device.property.json", - RoutingKey( - RoutingKey.DEVICES_PROPERTY_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.device.property.json", - RoutingKey( - RoutingKey.DEVICES_PROPERTY_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.device.property.json", - RoutingKey( - RoutingKey.DEVICES_CONFIGURATION_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.device.configuration.json", - RoutingKey( - RoutingKey.DEVICES_CONFIGURATION_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.device.configuration.json", - RoutingKey( - RoutingKey.DEVICES_CONFIGURATION_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.device.configuration.json", - RoutingKey( - RoutingKey.DEVICES_CONTROL_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.device.control.json", - RoutingKey( - RoutingKey.DEVICES_CONTROL_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.device.control.json", - RoutingKey( - RoutingKey.DEVICES_CONTROL_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.device.control.json", - RoutingKey(RoutingKey.CHANNELS_ENTITY_CREATED).value: "resources/schemas/devices-module/entity.channel.json", - RoutingKey(RoutingKey.CHANNELS_ENTITY_UPDATED).value: "resources/schemas/devices-module/entity.channel.json", - RoutingKey(RoutingKey.CHANNELS_ENTITY_DELETED).value: "resources/schemas/devices-module/entity.channel.json", - RoutingKey( - RoutingKey.CHANNELS_PROPERTY_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.channel.property.json", - RoutingKey( - RoutingKey.CHANNELS_PROPERTY_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.channel.property.json", - RoutingKey( - RoutingKey.CHANNELS_PROPERTY_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.channel.property.json", - RoutingKey( - RoutingKey.CHANNELS_CONFIGURATION_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.channel.configuration.json", - RoutingKey( - RoutingKey.CHANNELS_CONFIGURATION_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.channel.configuration.json", - RoutingKey( - RoutingKey.CHANNELS_CONFIGURATION_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.channel.configuration.json", - RoutingKey( - RoutingKey.CHANNELS_CONTROL_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.channel.control.json", - RoutingKey( - RoutingKey.CHANNELS_CONTROL_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.channel.control.json", - RoutingKey( - RoutingKey.CHANNELS_CONTROL_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.channel.control.json", - RoutingKey( - RoutingKey.CONNECTORS_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.connector.json", - RoutingKey( - RoutingKey.CONNECTORS_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.connector.json", - RoutingKey( - RoutingKey.CONNECTORS_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.connector.json", - RoutingKey( - RoutingKey.CONNECTORS_CONTROL_ENTITY_CREATED - ).value: "resources/schemas/devices-module/entity.connector.control.json", - RoutingKey( - RoutingKey.CONNECTORS_CONTROL_ENTITY_UPDATED - ).value: "resources/schemas/devices-module/entity.connector.control.json", - RoutingKey( - RoutingKey.CONNECTORS_CONTROL_ENTITY_DELETED - ).value: "resources/schemas/devices-module/entity.connector.control.json", - }, - ModuleOrigin(ModuleOrigin.TRIGGERS_MODULE).value: { - RoutingKey(RoutingKey.TRIGGERS_ENTITY_CREATED).value: "resources/schemas/triggers-module/entity.trigger.json", - RoutingKey(RoutingKey.TRIGGERS_ENTITY_UPDATED).value: "resources/schemas/triggers-module/entity.trigger.json", - RoutingKey(RoutingKey.TRIGGERS_ENTITY_DELETED).value: "resources/schemas/triggers-module/entity.trigger.json", - RoutingKey( - RoutingKey.TRIGGERS_CONTROL_ENTITY_CREATED - ).value: "resources/schemas/triggers-module/entity.trigger.control.json", - RoutingKey( - RoutingKey.TRIGGERS_CONTROL_ENTITY_UPDATED - ).value: "resources/schemas/triggers-module/entity.trigger.control.json", - RoutingKey( - RoutingKey.TRIGGERS_CONTROL_ENTITY_DELETED - ).value: "resources/schemas/triggers-module/entity.trigger.control.json", - RoutingKey( - RoutingKey.TRIGGERS_ACTIONS_ENTITY_CREATED - ).value: "resources/schemas/triggers-module/entity.action.json", - RoutingKey( - RoutingKey.TRIGGERS_ACTIONS_ENTITY_UPDATED - ).value: "resources/schemas/triggers-module/entity.action.json", - RoutingKey( - RoutingKey.TRIGGERS_ACTIONS_ENTITY_DELETED - ).value: "resources/schemas/triggers-module/entity.action.json", - RoutingKey( - RoutingKey.TRIGGERS_NOTIFICATIONS_ENTITY_CREATED - ).value: "resources/schemas/triggers-module/entity.notification.json", - RoutingKey( - RoutingKey.TRIGGERS_NOTIFICATIONS_ENTITY_UPDATED - ).value: "resources/schemas/triggers-module/entity.notification.json", - RoutingKey( - RoutingKey.TRIGGERS_NOTIFICATIONS_ENTITY_DELETED - ).value: "resources/schemas/triggers-module/entity.notification.json", - RoutingKey( - RoutingKey.TRIGGERS_CONDITIONS_ENTITY_CREATED - ).value: "resources/schemas/triggers-module/entity.condition.json", - RoutingKey( - RoutingKey.TRIGGERS_CONDITIONS_ENTITY_UPDATED - ).value: "resources/schemas/triggers-module/entity.condition.json", - RoutingKey( - RoutingKey.TRIGGERS_CONDITIONS_ENTITY_DELETED - ).value: "resources/schemas/triggers-module/entity.condition.json", - }, + RoutingKey(RoutingKey.DEVICES_PROPERTIES_DATA).value: "resources/schemas/data/data.device.property.json", + RoutingKey(RoutingKey.DEVICES_CONFIGURATION_DATA).value: "resources/schemas/data/data.device.configuration.json", + RoutingKey(RoutingKey.DEVICES_CONTROL_ENTITY_DATA).value: "resources/schemas/data/data.device.control.json", + RoutingKey(RoutingKey.CHANNELS_PROPERTIES_DATA).value: "resources/schemas/data/data.channel.property.json", + RoutingKey(RoutingKey.CHANNELS_CONFIGURATION_DATA).value: "resources/schemas/data/data.channel.configuration.json", + RoutingKey(RoutingKey.CHANNELS_CONTROL_ENTITY_DATA).value: "resources/schemas/data/data.channel.control.json", + RoutingKey(RoutingKey.CONNECTORS_CONTROL_ENTITY_DATA).value: "resources/schemas/data/data.connector.control.json", + RoutingKey(RoutingKey.TRIGGERS_CONTROL_ENTITY_DATA).value: "resources/schemas/data/data.trigger.control.json", + RoutingKey(RoutingKey.ACCOUNTS_ENTITY_REPORTED).value: "resources/schemas/accounts-module/entity.account.json", + RoutingKey(RoutingKey.ACCOUNTS_ENTITY_CREATED).value: "resources/schemas/accounts-module/entity.account.json", + RoutingKey(RoutingKey.ACCOUNTS_ENTITY_UPDATED).value: "resources/schemas/accounts-module/entity.account.json", + RoutingKey(RoutingKey.ACCOUNTS_ENTITY_DELETED).value: "resources/schemas/accounts-module/entity.account.json", + RoutingKey(RoutingKey.EMAILS_ENTITY_REPORTED).value: "resources/schemas/accounts-module/entity.email.json", + RoutingKey(RoutingKey.EMAILS_ENTITY_CREATED).value: "resources/schemas/accounts-module/entity.email.json", + RoutingKey(RoutingKey.EMAILS_ENTITY_UPDATED).value: "resources/schemas/accounts-module/entity.email.json", + RoutingKey(RoutingKey.EMAILS_ENTITY_DELETED).value: "resources/schemas/accounts-module/entity.email.json", + RoutingKey(RoutingKey.IDENTITIES_ENTITY_REPORTED).value: "resources/schemas/accounts-module/entity.identity.json", + RoutingKey(RoutingKey.IDENTITIES_ENTITY_CREATED).value: "resources/schemas/accounts-module/entity.identity.json", + RoutingKey(RoutingKey.IDENTITIES_ENTITY_UPDATED).value: "resources/schemas/accounts-module/entity.identity.json", + RoutingKey(RoutingKey.IDENTITIES_ENTITY_DELETED).value: "resources/schemas/accounts-module/entity.identity.json", + RoutingKey(RoutingKey.ROLES_ENTITY_REPORTED).value: "resources/schemas/accounts-module/entity.role.json", + RoutingKey(RoutingKey.ROLES_ENTITY_CREATED).value: "resources/schemas/accounts-module/entity.role.json", + RoutingKey(RoutingKey.ROLES_ENTITY_UPDATED).value: "resources/schemas/accounts-module/entity.role.json", + RoutingKey(RoutingKey.ROLES_ENTITY_DELETED).value: "resources/schemas/accounts-module/entity.role.json", + RoutingKey(RoutingKey.DEVICES_ENTITY_REPORTED).value: "resources/schemas/devices-module/entity.device.json", + RoutingKey(RoutingKey.DEVICES_ENTITY_CREATED).value: "resources/schemas/devices-module/entity.device.json", + RoutingKey(RoutingKey.DEVICES_ENTITY_UPDATED).value: "resources/schemas/devices-module/entity.device.json", + RoutingKey(RoutingKey.DEVICES_ENTITY_DELETED).value: "resources/schemas/devices-module/entity.device.json", + RoutingKey( + RoutingKey.DEVICES_PROPERTY_ENTITY_REPORTED + ).value: "resources/schemas/devices-module/entity.device.property.json", + RoutingKey( + RoutingKey.DEVICES_PROPERTY_ENTITY_CREATED + ).value: "resources/schemas/devices-module/entity.device.property.json", + RoutingKey( + RoutingKey.DEVICES_PROPERTY_ENTITY_UPDATED + ).value: "resources/schemas/devices-module/entity.device.property.json", + RoutingKey( + RoutingKey.DEVICES_PROPERTY_ENTITY_DELETED + ).value: "resources/schemas/devices-module/entity.device.property.json", + RoutingKey( + RoutingKey.DEVICES_CONFIGURATION_ENTITY_REPORTED + ).value: "resources/schemas/devices-module/entity.device.configuration.json", + RoutingKey( + RoutingKey.DEVICES_CONFIGURATION_ENTITY_CREATED + ).value: "resources/schemas/devices-module/entity.device.configuration.json", + RoutingKey( + RoutingKey.DEVICES_CONFIGURATION_ENTITY_UPDATED + ).value: "resources/schemas/devices-module/entity.device.configuration.json", + RoutingKey( + RoutingKey.DEVICES_CONFIGURATION_ENTITY_DELETED + ).value: "resources/schemas/devices-module/entity.device.configuration.json", + RoutingKey( + RoutingKey.DEVICES_CONTROL_ENTITY_REPORTED + ).value: "resources/schemas/devices-module/entity.device.control.json", + RoutingKey( + RoutingKey.DEVICES_CONTROL_ENTITY_CREATED + ).value: "resources/schemas/devices-module/entity.device.control.json", + RoutingKey( + RoutingKey.DEVICES_CONTROL_ENTITY_UPDATED + ).value: "resources/schemas/devices-module/entity.device.control.json", + RoutingKey( + RoutingKey.DEVICES_CONTROL_ENTITY_DELETED + ).value: "resources/schemas/devices-module/entity.device.control.json", + RoutingKey(RoutingKey.CHANNELS_ENTITY_REPORTED).value: "resources/schemas/devices-module/entity.channel.json", + RoutingKey(RoutingKey.CHANNELS_ENTITY_CREATED).value: "resources/schemas/devices-module/entity.channel.json", + RoutingKey(RoutingKey.CHANNELS_ENTITY_UPDATED).value: "resources/schemas/devices-module/entity.channel.json", + RoutingKey(RoutingKey.CHANNELS_ENTITY_DELETED).value: "resources/schemas/devices-module/entity.channel.json", + RoutingKey( + RoutingKey.CHANNELS_PROPERTY_ENTITY_REPORTED + ).value: "resources/schemas/devices-module/entity.channel.property.json", + RoutingKey( + RoutingKey.CHANNELS_PROPERTY_ENTITY_CREATED + ).value: "resources/schemas/devices-module/entity.channel.property.json", + RoutingKey( + RoutingKey.CHANNELS_PROPERTY_ENTITY_UPDATED + ).value: "resources/schemas/devices-module/entity.channel.property.json", + RoutingKey( + RoutingKey.CHANNELS_PROPERTY_ENTITY_DELETED + ).value: "resources/schemas/devices-module/entity.channel.property.json", + RoutingKey( + RoutingKey.CHANNELS_CONFIGURATION_ENTITY_REPORTED + ).value: "resources/schemas/devices-module/entity.channel.configuration.json", + RoutingKey( + RoutingKey.CHANNELS_CONFIGURATION_ENTITY_CREATED + ).value: "resources/schemas/devices-module/entity.channel.configuration.json", + RoutingKey( + RoutingKey.CHANNELS_CONFIGURATION_ENTITY_UPDATED + ).value: "resources/schemas/devices-module/entity.channel.configuration.json", + RoutingKey( + RoutingKey.CHANNELS_CONFIGURATION_ENTITY_DELETED + ).value: "resources/schemas/devices-module/entity.channel.configuration.json", + RoutingKey( + RoutingKey.CHANNELS_CONTROL_ENTITY_REPORTED + ).value: "resources/schemas/devices-module/entity.channel.control.json", + RoutingKey( + RoutingKey.CHANNELS_CONTROL_ENTITY_CREATED + ).value: "resources/schemas/devices-module/entity.channel.control.json", + RoutingKey( + RoutingKey.CHANNELS_CONTROL_ENTITY_UPDATED + ).value: "resources/schemas/devices-module/entity.channel.control.json", + RoutingKey( + RoutingKey.CHANNELS_CONTROL_ENTITY_DELETED + ).value: "resources/schemas/devices-module/entity.channel.control.json", + RoutingKey(RoutingKey.CONNECTORS_ENTITY_REPORTED).value: "resources/schemas/devices-module/entity.connector.json", + RoutingKey(RoutingKey.CONNECTORS_ENTITY_CREATED).value: "resources/schemas/devices-module/entity.connector.json", + RoutingKey(RoutingKey.CONNECTORS_ENTITY_UPDATED).value: "resources/schemas/devices-module/entity.connector.json", + RoutingKey(RoutingKey.CONNECTORS_ENTITY_DELETED).value: "resources/schemas/devices-module/entity.connector.json", + RoutingKey( + RoutingKey.CONNECTORS_CONTROL_ENTITY_REPORTED + ).value: "resources/schemas/devices-module/entity.connector.control.json", + RoutingKey( + RoutingKey.CONNECTORS_CONTROL_ENTITY_CREATED + ).value: "resources/schemas/devices-module/entity.connector.control.json", + RoutingKey( + RoutingKey.CONNECTORS_CONTROL_ENTITY_UPDATED + ).value: "resources/schemas/devices-module/entity.connector.control.json", + RoutingKey( + RoutingKey.CONNECTORS_CONTROL_ENTITY_DELETED + ).value: "resources/schemas/devices-module/entity.connector.control.json", + RoutingKey(RoutingKey.TRIGGERS_ENTITY_REPORTED).value: "resources/schemas/triggers-module/entity.trigger.json", + RoutingKey(RoutingKey.TRIGGERS_ENTITY_CREATED).value: "resources/schemas/triggers-module/entity.trigger.json", + RoutingKey(RoutingKey.TRIGGERS_ENTITY_UPDATED).value: "resources/schemas/triggers-module/entity.trigger.json", + RoutingKey(RoutingKey.TRIGGERS_ENTITY_DELETED).value: "resources/schemas/triggers-module/entity.trigger.json", + RoutingKey( + RoutingKey.TRIGGERS_CONTROL_ENTITY_REPORTED + ).value: "resources/schemas/triggers-module/entity.trigger.control.json", + RoutingKey( + RoutingKey.TRIGGERS_CONTROL_ENTITY_CREATED + ).value: "resources/schemas/triggers-module/entity.trigger.control.json", + RoutingKey( + RoutingKey.TRIGGERS_CONTROL_ENTITY_UPDATED + ).value: "resources/schemas/triggers-module/entity.trigger.control.json", + RoutingKey( + RoutingKey.TRIGGERS_CONTROL_ENTITY_DELETED + ).value: "resources/schemas/triggers-module/entity.trigger.control.json", + RoutingKey( + RoutingKey.TRIGGERS_ACTIONS_ENTITY_REPORTED + ).value: "resources/schemas/triggers-module/entity.action.json", + RoutingKey( + RoutingKey.TRIGGERS_ACTIONS_ENTITY_CREATED + ).value: "resources/schemas/triggers-module/entity.action.json", + RoutingKey( + RoutingKey.TRIGGERS_ACTIONS_ENTITY_UPDATED + ).value: "resources/schemas/triggers-module/entity.action.json", + RoutingKey( + RoutingKey.TRIGGERS_ACTIONS_ENTITY_DELETED + ).value: "resources/schemas/triggers-module/entity.action.json", + RoutingKey( + RoutingKey.TRIGGERS_NOTIFICATIONS_ENTITY_REPORTED + ).value: "resources/schemas/triggers-module/entity.notification.json", + RoutingKey( + RoutingKey.TRIGGERS_NOTIFICATIONS_ENTITY_CREATED + ).value: "resources/schemas/triggers-module/entity.notification.json", + RoutingKey( + RoutingKey.TRIGGERS_NOTIFICATIONS_ENTITY_UPDATED + ).value: "resources/schemas/triggers-module/entity.notification.json", + RoutingKey( + RoutingKey.TRIGGERS_NOTIFICATIONS_ENTITY_DELETED + ).value: "resources/schemas/triggers-module/entity.notification.json", + RoutingKey( + RoutingKey.TRIGGERS_CONDITIONS_ENTITY_REPORTED + ).value: "resources/schemas/triggers-module/entity.condition.json", + RoutingKey( + RoutingKey.TRIGGERS_CONDITIONS_ENTITY_CREATED + ).value: "resources/schemas/triggers-module/entity.condition.json", + RoutingKey( + RoutingKey.TRIGGERS_CONDITIONS_ENTITY_UPDATED + ).value: "resources/schemas/triggers-module/entity.condition.json", + RoutingKey( + RoutingKey.TRIGGERS_CONDITIONS_ENTITY_DELETED + ).value: "resources/schemas/triggers-module/entity.condition.json", } diff --git a/modules_metadata/routing.py b/modules_metadata/routing.py index 3bafafe..ca2b95c 100644 --- a/modules_metadata/routing.py +++ b/modules_metadata/routing.py @@ -36,113 +36,126 @@ class RoutingKey(ExtendedEnum): @author Adam Kadlec """ + # Global + DEVICES_PROPERTIES_DATA: str = "fb.bus.data.device.property" + DEVICES_CONFIGURATION_DATA: str = "fb.bus.data.device.configuration" + DEVICES_CONTROL_ENTITY_DATA = "fb.bus.data.device.control" + CHANNELS_PROPERTIES_DATA: str = "fb.bus.data.channel.property" + CHANNELS_CONFIGURATION_DATA: str = "fb.bus.data.channel.configuration" + CHANNELS_CONTROL_ENTITY_DATA = "fb.bus.data.channel.control" + CONNECTORS_CONTROL_ENTITY_DATA = "fb.bus.data.connector.control" + TRIGGERS_CONTROL_ENTITY_DATA = "fb.bus.data.trigger.control" + # Accounts + ACCOUNTS_ENTITY_REPORTED = "fb.bus.entity.reported.account" ACCOUNTS_ENTITY_CREATED = "fb.bus.entity.created.account" ACCOUNTS_ENTITY_UPDATED = "fb.bus.entity.updated.account" ACCOUNTS_ENTITY_DELETED = "fb.bus.entity.deleted.account" # Emails + EMAILS_ENTITY_REPORTED = "fb.bus.entity.reported.email" EMAILS_ENTITY_CREATED = "fb.bus.entity.created.email" EMAILS_ENTITY_UPDATED = "fb.bus.entity.updated.email" EMAILS_ENTITY_DELETED = "fb.bus.entity.deleted.email" # Identities + IDENTITIES_ENTITY_REPORTED = "fb.bus.entity.reported.identity" IDENTITIES_ENTITY_CREATED = "fb.bus.entity.created.identity" IDENTITIES_ENTITY_UPDATED = "fb.bus.entity.updated.identity" IDENTITIES_ENTITY_DELETED = "fb.bus.entity.deleted.identity" # Roles + ROLES_ENTITY_REPORTED = "fb.bus.entity.reported.role" ROLES_ENTITY_CREATED = "fb.bus.entity.created.role" ROLES_ENTITY_UPDATED = "fb.bus.entity.updated.role" ROLES_ENTITY_DELETED = "fb.bus.entity.deleted.role" # Devices + DEVICES_ENTITY_REPORTED: str = "fb.bus.entity.reported.device" DEVICES_ENTITY_CREATED: str = "fb.bus.entity.created.device" DEVICES_ENTITY_UPDATED: str = "fb.bus.entity.updated.device" DEVICES_ENTITY_DELETED: str = "fb.bus.entity.deleted.device" # Devices properties + DEVICES_PROPERTY_ENTITY_REPORTED: str = "fb.bus.entity.reported.device.property" DEVICES_PROPERTY_ENTITY_CREATED: str = "fb.bus.entity.created.device.property" DEVICES_PROPERTY_ENTITY_UPDATED: str = "fb.bus.entity.updated.device.property" DEVICES_PROPERTY_ENTITY_DELETED: str = "fb.bus.entity.deleted.device.property" - DEVICES_PROPERTIES_DATA: str = "fb.bus.data.device.property" - # Devices configuration + DEVICES_CONFIGURATION_ENTITY_REPORTED: str = "fb.bus.entity.reported.device.configuration" DEVICES_CONFIGURATION_ENTITY_CREATED: str = "fb.bus.entity.created.device.configuration" DEVICES_CONFIGURATION_ENTITY_UPDATED: str = "fb.bus.entity.updated.device.configuration" DEVICES_CONFIGURATION_ENTITY_DELETED: str = "fb.bus.entity.deleted.device.configuration" - DEVICES_CONFIGURATION_DATA: str = "fb.bus.data.device.configuration" - # Devices control + DEVICES_CONTROL_ENTITY_REPORTED = "fb.bus.entity.reported.device.control" DEVICES_CONTROL_ENTITY_CREATED = "fb.bus.entity.created.device.control" DEVICES_CONTROL_ENTITY_UPDATED = "fb.bus.entity.updated.device.control" DEVICES_CONTROL_ENTITY_DELETED = "fb.bus.entity.deleted.device.control" - DEVICES_CONTROL_ENTITY_DATA = "fb.bus.data.device.control" - # Channels + CHANNELS_ENTITY_REPORTED: str = "fb.bus.entity.reported.channel" CHANNELS_ENTITY_CREATED: str = "fb.bus.entity.created.channel" CHANNELS_ENTITY_UPDATED: str = "fb.bus.entity.updated.channel" CHANNELS_ENTITY_DELETED: str = "fb.bus.entity.deleted.channel" # Channels properties + CHANNELS_PROPERTY_ENTITY_REPORTED: str = "fb.bus.entity.reported.channel.property" CHANNELS_PROPERTY_ENTITY_CREATED: str = "fb.bus.entity.created.channel.property" CHANNELS_PROPERTY_ENTITY_UPDATED: str = "fb.bus.entity.updated.channel.property" CHANNELS_PROPERTY_ENTITY_DELETED: str = "fb.bus.entity.deleted.channel.property" - CHANNELS_PROPERTIES_DATA: str = "fb.bus.data.channel.property" - # Channels configuration + CHANNELS_CONFIGURATION_ENTITY_REPORTED: str = "fb.bus.entity.reported.channel.configuration" CHANNELS_CONFIGURATION_ENTITY_CREATED: str = "fb.bus.entity.created.channel.configuration" CHANNELS_CONFIGURATION_ENTITY_UPDATED: str = "fb.bus.entity.updated.channel.configuration" CHANNELS_CONFIGURATION_ENTITY_DELETED: str = "fb.bus.entity.deleted.channel.configuration" - CHANNELS_CONFIGURATION_DATA: str = "fb.bus.data.channel.configuration" - # Channels control + CHANNELS_CONTROL_ENTITY_REPORTED = "fb.bus.entity.reported.channel.control" CHANNELS_CONTROL_ENTITY_CREATED = "fb.bus.entity.created.channel.control" CHANNELS_CONTROL_ENTITY_UPDATED = "fb.bus.entity.updated.channel.control" CHANNELS_CONTROL_ENTITY_DELETED = "fb.bus.entity.deleted.channel.control" - CHANNELS_CONTROL_ENTITY_DATA = "fb.bus.data.channel.control" - # Connectors + CONNECTORS_ENTITY_REPORTED = "fb.bus.entity.reported.connector" CONNECTORS_ENTITY_CREATED = "fb.bus.entity.created.connector" CONNECTORS_ENTITY_UPDATED = "fb.bus.entity.updated.connector" CONNECTORS_ENTITY_DELETED = "fb.bus.entity.deleted.connector" # Connectors control + CONNECTORS_CONTROL_ENTITY_REPORTED = "fb.bus.entity.reported.connector.control" CONNECTORS_CONTROL_ENTITY_CREATED = "fb.bus.entity.created.connector.control" CONNECTORS_CONTROL_ENTITY_UPDATED = "fb.bus.entity.updated.connector.control" CONNECTORS_CONTROL_ENTITY_DELETED = "fb.bus.entity.deleted.connector.control" - CONNECTORS_CONTROL_ENTITY_DATA = "fb.bus.data.connector.control" - # Triggers + TRIGGERS_ENTITY_REPORTED = "fb.bus.entity.reported.trigger" TRIGGERS_ENTITY_CREATED = "fb.bus.entity.created.trigger" TRIGGERS_ENTITY_UPDATED = "fb.bus.entity.updated.trigger" TRIGGERS_ENTITY_DELETED = "fb.bus.entity.deleted.trigger" # Triggers control + TRIGGERS_CONTROL_ENTITY_REPORTED = "fb.bus.entity.reported.trigger.control" TRIGGERS_CONTROL_ENTITY_CREATED = "fb.bus.entity.created.trigger.control" TRIGGERS_CONTROL_ENTITY_UPDATED = "fb.bus.entity.updated.trigger.control" TRIGGERS_CONTROL_ENTITY_DELETED = "fb.bus.entity.deleted.trigger.control" - TRIGGERS_CONTROL_ENTITY_DATA = "fb.bus.data.trigger.control" - # Triggers actions + TRIGGERS_ACTIONS_ENTITY_REPORTED = "fb.bus.entity.reported.trigger.action" TRIGGERS_ACTIONS_ENTITY_CREATED = "fb.bus.entity.created.trigger.action" TRIGGERS_ACTIONS_ENTITY_UPDATED = "fb.bus.entity.updated.trigger.action" TRIGGERS_ACTIONS_ENTITY_DELETED = "fb.bus.entity.deleted.trigger.action" # Triggers notifications + TRIGGERS_NOTIFICATIONS_ENTITY_REPORTED = "fb.bus.entity.reported.trigger.notification" TRIGGERS_NOTIFICATIONS_ENTITY_CREATED = "fb.bus.entity.created.trigger.notification" TRIGGERS_NOTIFICATIONS_ENTITY_UPDATED = "fb.bus.entity.updated.trigger.notification" TRIGGERS_NOTIFICATIONS_ENTITY_DELETED = "fb.bus.entity.deleted.trigger.notification" # Triggers conditions + TRIGGERS_CONDITIONS_ENTITY_REPORTED = "fb.bus.entity.reported.trigger.condition" TRIGGERS_CONDITIONS_ENTITY_CREATED = "fb.bus.entity.created.trigger.condition" TRIGGERS_CONDITIONS_ENTITY_UPDATED = "fb.bus.entity.updated.trigger.condition" TRIGGERS_CONDITIONS_ENTITY_DELETED = "fb.bus.entity.deleted.trigger.condition" diff --git a/modules_metadata/triggers_module.py b/modules_metadata/triggers_module.py index b6e57a9..4d7ad41 100644 --- a/modules_metadata/triggers_module.py +++ b/modules_metadata/triggers_module.py @@ -41,7 +41,7 @@ class TriggerType(ExtendedEnum): @unique -class TriggerActionType(ExtendedEnum): +class ActionType(ExtendedEnum): """ Trigger action type @@ -56,7 +56,7 @@ class TriggerActionType(ExtendedEnum): @unique -class TriggerConditionType(ExtendedEnum): +class ConditionType(ExtendedEnum): """ Trigger condition type @@ -73,7 +73,7 @@ class TriggerConditionType(ExtendedEnum): @unique -class TriggerNotificationType(ExtendedEnum): +class NotificationType(ExtendedEnum): """ Trigger notification type @@ -88,7 +88,7 @@ class TriggerNotificationType(ExtendedEnum): @unique -class TriggerConditionOperator(ExtendedEnum): +class ConditionOperator(ExtendedEnum): """ Condition operator diff --git a/modules_metadata/types.py b/modules_metadata/types.py index 4fa1138..21964f2 100644 --- a/modules_metadata/types.py +++ b/modules_metadata/types.py @@ -61,6 +61,35 @@ class ModulePrefix(ExtendedEnum): UI_MODULE: str = "ui-module" +@unique +class PluginOrigin(ExtendedEnum): + """ + Plugin origin + + @package FastyBird:ModulesMetadata! + @module types + + @author Adam Kadlec + """ + + NOT_SPECIFIED: str = "*" + + FB_BUS_CONNECTOR_PLUGIN: str = "com.fastybird.fb-bus-connector-plugin" + FB_MQTT_CONNECTOR_PLUGIN: str = "com.fastybird.fb-mqtt-connector-plugin" + SHELLY_CONNECTOR_PLUGIN: str = "com.fastybird.shelly-connector-plugin" + TUYA_CONNECTOR_PLUGIN: str = "com.fastybird.tuya-connector-plugin" + SONOFF_CONNECTOR_PLUGIN: str = "com.fastybird.sonoff-connector-plugin" + MODBUS_CONNECTOR_PLUGIN: str = "com.fastybird.modbus-connector-plugin" + + WS_EXCHANGE_PLUGIN: str = "com.fastybird.ws-exchange-plugin" + + REDISDB_EXCHANGE_PLUGIN: str = "com.fastybird.redisdb-exchange-plugin" + RABBITMQ_EXCHANGE_PLUGIN: str = "com.fastybird.rabbitmq-exchange-plugin" + + REDISDB_STORAGE_PLUGIN: str = "com.fastybird.redisdb-storage-plugin" + COUCHDB_STORAGE_PLUGIN: str = "com.fastybird.couchdb-storage-plugin" + + @unique class DataType(ExtendedEnum): """ @@ -132,7 +161,7 @@ class ControlName(ExtendedEnum): Known control name @package FastyBird:ModulesMetadata! - @module devices_module + @module types @author Adam Kadlec """ @@ -140,7 +169,33 @@ class ControlName(ExtendedEnum): CONFIGURE: str = "configure" RESET: str = "reset" REBOOT: str = "reboot" - RECONNECT: str = "reconnect" - FACTORY_RESET: str = "factory-reset" - OTA: str = "ota" - TRIGGER: str = "trigger" + + +@unique +class PropertyAction(ExtendedEnum): + """ + Property data action + + @package FastyBird:ModulesMetadata! + @module types + + @author Adam Kadlec + """ + + SET: str = "set" + GET: str = "get" + REPORT: str = "report" + + +@unique +class ControlAction(ExtendedEnum): + """ + Control data action + + @package FastyBird:ModulesMetadata! + @module types + + @author Adam Kadlec + """ + + SET: str = "set" diff --git a/package.json b/package.json index 932f318..988261a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fastybird/modules-metadata", - "version": "0.20.1", + "version": "0.21.0", "description": "FastyBird metadata reader & validator for modules", "keywords": [ "fastybird", diff --git a/public/lib/types/accounts-module.ts b/public/lib/types/accounts-module.ts index d7975ba..c05ea59 100644 --- a/public/lib/types/accounts-module.ts +++ b/public/lib/types/accounts-module.ts @@ -1,65 +1,63 @@ export enum AccountState { - ACTIVE = 'active', - BLOCKED = 'blocked', - DELETED = 'deleted', - NOT_ACTIVATED = 'notActivated', - APPROVAL_WAITING = 'approvalWaiting', + ACTIVE = 'active', + BLOCKED = 'blocked', + DELETED = 'deleted', + NOT_ACTIVATED = 'notActivated', + APPROVAL_WAITING = 'approvalWaiting', } export enum IdentityState { - ACTIVE = 'active', - BLOCKED = 'blocked', - DELETED = 'deleted', - INVALID = 'invalid', + ACTIVE = 'active', + BLOCKED = 'blocked', + DELETED = 'deleted', + INVALID = 'invalid', } export interface AccountEntity { - id: string - state: AccountState - registered: string | null - last_visit: string | null - roles: string[] - first_name?: string - last_name?: string - middle_name?: string - email?: string - language?: string - device?: string - owner?: string - - [k: string]: string | string[] | AccountState | null | undefined + id: string + first_name: string + last_name: string + middle_name: string + state: AccountState + registered: string | null + last_visit: string | null + email: string + language: string + roles: string[] + + [k: string]: string | string[] | AccountState | null } export interface EmailEntity { - id: string - address: string - default: boolean - verified: boolean - private: boolean - public: boolean - account: string - - [k: string]: string | boolean + id: string + address: string + default: boolean + verified: boolean + private: boolean + public: boolean + account: string + + [k: string]: string | boolean } export interface IdentityEntity { - id: string - state: IdentityState - uid: string - password?: string - account: string + id: string + state: IdentityState + uid: string + password?: string + account: string - [k: string]: string | IdentityState | undefined + [k: string]: string | IdentityState | undefined } export interface RoleEntity { - id: string - name: string - description: string - anonymous: boolean - authenticated: boolean - administrator: boolean - parent: string | null - - [k: string]: string | boolean | null + id: string + name: string + description: string + anonymous: boolean + authenticated: boolean + administrator: boolean + parent: string | null + + [k: string]: string | boolean | null } diff --git a/public/lib/types/data.ts b/public/lib/types/data.ts new file mode 100644 index 0000000..b45a184 --- /dev/null +++ b/public/lib/types/data.ts @@ -0,0 +1,77 @@ +import { ButtonPayload, ControlAction, PropertyAction, SwitchPayload } from '@/lib/types/types' + +export interface ConnectorControlData { + action: ControlAction + control: string + connector: string + expected_value?: + | null + | string + | number + | boolean + + [k: string]: string | number | boolean | ControlAction | null | undefined +} + +export interface DeviceControlData { + action: ControlAction + control: string + device: string + expected_value?: + | null + | string + | number + | boolean + + [k: string]: string | number | boolean | ControlAction | null | undefined +} + +export interface ChannelControlData { + action: ControlAction + control: string + device: string + channel: string + expected_value?: + | null + | string + | number + | boolean + + [k: string]: string | number | boolean | ControlAction | null | undefined +} + +export interface TriggerControlData { + action: ControlAction + control: string + trigger: string + expected_value?: + | null + | string + | number + | boolean + + [k: string]: string | number | boolean | ControlAction | null | undefined +} + +export interface DevicePropertyData { + action: PropertyAction + device: string + property: string + expected_value?: string | number | boolean | ButtonPayload | SwitchPayload + actual_value?: string | number | boolean | ButtonPayload | SwitchPayload + pending?: boolean + + [k: string]: string | number | boolean | PropertyAction | ButtonPayload | SwitchPayload | undefined +} + +export interface ChannelPropertyData { + action: PropertyAction + device: string + channel: string + property: string + expected_value?: string | number | boolean | ButtonPayload | SwitchPayload + actual_value?: string | number | boolean | ButtonPayload | SwitchPayload + pending?: boolean + + [k: string]: string | number | boolean | PropertyAction | ButtonPayload | SwitchPayload | undefined +} diff --git a/public/lib/types/devices-module.ts b/public/lib/types/devices-module.ts index e022737..bd41606 100644 --- a/public/lib/types/devices-module.ts +++ b/public/lib/types/devices-module.ts @@ -1,362 +1,293 @@ import { ButtonPayload, DataType, SwitchPayload } from '@/lib/types/types' export enum ConnectorType { - FB_BUS = 'fb-bus', - FB_MQTT = 'fb-mqtt', - SHELLY = 'shelly', - TUYA = 'tuya', - SONOFF = 'sonoff', - MODBUS = 'modbus', + FB_BUS = 'fb-bus', + FB_MQTT = 'fb-mqtt', + SHELLY = 'shelly', + TUYA = 'tuya', + SONOFF = 'sonoff', + MODBUS = 'modbus', } -export enum DeviceConnectionState { - CONNECTED = 'connected', - DISCONNECTED = 'disconnected', - INIT = 'init', - READY = 'ready', - RUNNING = 'running', - SLEEPING = 'sleeping', - STOPPED = 'stopped', - LOST = 'lost', - ALERT = 'alert', - UNKNOWN = 'unknown', +export enum DeviceType { + LOCAL = 'local', + NETWORK = 'network', + VIRTUAL = 'virtual', + HOMEKIT = 'homekit', } -export enum DeviceType { - LOCAL = 'local', - NETWORK = 'network', - VIRTUAL = 'virtual', - HOMEKIT = 'homekit', +export enum PropertyType { + DYNAMIC = 'dynamic', + STATIC = 'static', } -export enum HardwareManufacturer { - GENERIC = 'generic', - FASTYBIRD = 'fastybird', - ITEAD = 'itead', - AI_THINKER = 'ai_thinker', - SHELLY = 'shelly', - TUYA = 'tuya', - SONOFF = 'sonoff', +export enum DeviceConnectionState { + CONNECTED = 'connected', + DISCONNECTED = 'disconnected', + INIT = 'init', + READY = 'ready', + RUNNING = 'running', + SLEEPING = 'sleeping', + STOPPED = 'stopped', + LOST = 'lost', + ALERT = 'alert', + UNKNOWN = 'unknown', } -export enum FirmwareManufacturer { - GENERIC = 'generic', - FASTYBIRD = 'fastybird', - SHELLY = 'shelly', - TUYA = 'tuya', - SONOFF = 'sonoff', +export enum ConfigurationField { + BOOLEAN = 'boolean', + NUMBER = 'number', + SELECT = 'select', + TEXT = 'text', } -export enum DeviceModel { - CUSTOM = 'custom', - - SONOFF_BASIC = 'sonoff_basic', - SONOFF_RF = 'sonoff_rf', - SONOFF_TH = 'sonoff_th', - SONOFF_SV = 'sonoff_sv', - SONOFF_SLAMPHER = 'sonoff_slampher', - SONOFF_S20 = 'sonoff_s20', - SONOFF_TOUCH = 'sonoff_touch', - SONOFF_POW = 'sonoff_pow', - SONOFF_POW_R2 = 'sonoff_pow_r2', - SONOFF_DUAL = 'sonoff_dual', - SONOFF_DUAL_R2 = 'sonoff_dual_r2', - SONOFF_4CH = 'sonoff_4ch', - SONOFF_4CH_PRO = 'sonoff_4ch_pro', - SONOFF_RF_BRIDGE = 'sonoff_rf_bridge', - SONOFF_B1 = 'sonoff_b1', - SONOFF_LED = 'sonoff_led', - SONOFF_T1_1CH = 'sonoff_t1_1ch', - SONOFF_T1_2CH = 'sonoff_t1_2ch', - SONOFF_T1_3CH = 'sonoff_t1_3ch', - SONOFF_S31 = 'sonoff_s31', - SONOFF_SC = 'sonoff_sc', - SONOFF_SC_PRO = 'sonoff_sc_pro', - SONOFF_PS_15 = 'sonoff_ps_15', - - AI_THINKER_AI_LIGHT = 'ai_thinker_ai_light', - - FASTYBIRD_WIFI_GW = 'fastybird_wifi_gw', - FASTYBIRD_3CH_POWER_STRIP_R1 = 'fastybird_3ch_power_strip_r1', - FASTYBIRD_8CH_BUTTONS = '8ch_buttons', - FASTYBIRD_16CH_BUTTONS = '16ch_buttons', +export enum ConfigurationBooleanFieldAttribute { + DEFAULT = 'default', } -export enum DevicePropertyName { - STATE = 'state', - BATTERY = 'battery', - WIFI = 'wifi', - SIGNAL = 'signal', - SSID = 'ssid', - RSSI = 'rssi', - VCC = 'vcc', - CPU_LOAD = 'cpu-load', - UPTIME = 'uptime', - IP_ADDRESS = 'ip-address', - STATUS_LED = 'status-led', - FREE_HEAP = 'free-heap', +export enum ConfigurationNumberFieldAttribute { + MIN = 'min', + MAX = 'max', + STEP = 'step', + DEFAULT = 'default', } -export enum ConfigurationFieldType { - BOOLEAN = 'boolean', - NUMBER = 'number', - SELECT = 'select', - TEXT = 'text', +export enum ConfigurationSelectFieldAttribute { + VALUES = 'values', + DEFAULT = 'default', } -export enum ConfigurationNumberFieldAttributeType { - MIN = 'min', - MAX = 'max', - STEP = 'step', - DEFAULT = 'default', +export enum ConfigurationTextFieldAttribute { + DEFAULT = 'default', } -export enum ConfigurationTextFieldAttributeType { - DEFAULT = 'default', +export enum DeviceModel { + CUSTOM = 'custom', + + SONOFF_BASIC = 'sonoff_basic', + SONOFF_RF = 'sonoff_rf', + SONOFF_TH = 'sonoff_th', + SONOFF_SV = 'sonoff_sv', + SONOFF_SLAMPHER = 'sonoff_slampher', + SONOFF_S20 = 'sonoff_s20', + SONOFF_TOUCH = 'sonoff_touch', + SONOFF_POW = 'sonoff_pow', + SONOFF_POW_R2 = 'sonoff_pow_r2', + SONOFF_DUAL = 'sonoff_dual', + SONOFF_DUAL_R2 = 'sonoff_dual_r2', + SONOFF_4CH = 'sonoff_4ch', + SONOFF_4CH_PRO = 'sonoff_4ch_pro', + SONOFF_RF_BRIDGE = 'sonoff_rf_bridge', + SONOFF_B1 = 'sonoff_b1', + SONOFF_LED = 'sonoff_led', + SONOFF_T1_1CH = 'sonoff_t1_1ch', + SONOFF_T1_2CH = 'sonoff_t1_2ch', + SONOFF_T1_3CH = 'sonoff_t1_3ch', + SONOFF_S31 = 'sonoff_s31', + SONOFF_SC = 'sonoff_sc', + SONOFF_SC_PRO = 'sonoff_sc_pro', + SONOFF_PS_15 = 'sonoff_ps_15', + + AI_THINKER_AI_LIGHT = 'ai_thinker_ai_light', + + FASTYBIRD_WIFI_GW = 'fastybird_wifi_gw', + FASTYBIRD_3CH_POWER_STRIP_R1 = 'fastybird_3ch_power_strip_r1', + FASTYBIRD_8CH_BUTTONS = '8ch_buttons', + FASTYBIRD_16CH_BUTTONS = '16ch_buttons', } -export enum ConfigurationBooleanFieldAttributeType { - DEFAULT = 'default', +export enum FirmwareManufacturer { + GENERIC = 'generic', + FASTYBIRD = 'fastybird', + SHELLY = 'shelly', + TUYA = 'tuya', + SONOFF = 'sonoff', } -export enum ConfigurationSelectFieldAttributeType { - VALUES = 'values', - DEFAULT = 'default', +export enum HardwareManufacturer { + GENERIC = 'generic', + FASTYBIRD = 'fastybird', + ITEAD = 'itead', + AI_THINKER = 'ai_thinker', + SHELLY = 'shelly', + TUYA = 'tuya', + SONOFF = 'sonoff', } -export enum PropertyType { - DYNAMIC = 'dynamic', - STATIC = 'static', +export enum DevicePropertyName { + STATE = 'state', + BATTERY = 'battery', + WIFI = 'wifi', + SIGNAL = 'signal', + SSID = 'ssid', + RSSI = 'rssi', + VCC = 'vcc', + CPU_LOAD = 'cpu-load', + UPTIME = 'uptime', + IP_ADDRESS = 'ip-address', + STATUS_LED = 'status-led', + FREE_HEAP = 'free-heap', } export interface ConnectorEntity { - id: string - type: ConnectorType - key: string - name: string - enabled: boolean - control: string[] - address?: number | null - serial_interface?: string | null - baud_rate?: number | null - server?: string | null - port?: number | null - secured_port?: number | null - username?: string | null - - [k: string]: string | number | string[] | ConnectorType | boolean | null | undefined + id: string + type: ConnectorType + key: string + name: string + enabled: boolean + address?: number | null + serial_interface?: string | null + baud_rate?: number | null + server?: string | null + port?: number | null + secured_port?: number | null + username?: string | null + owner: string | null + + [k: string]: string | number | boolean | ConnectorType | null | undefined } export interface ConnectorControlEntity { id: string name: string connector: string + owner: string | null - [k: string]: string + [k: string]: string | null } export interface DeviceEntity { - id: string - identifier: string - key: string - name: string | null - comment: string | null - enabled: boolean - hardware_version: string | null - hardware_manufacturer: HardwareManufacturer - hardware_model: DeviceModel - hardware_mac_address: string | null - firmware_manufacturer: FirmwareManufacturer - firmware_version: string | null - control: string[] - connector: string - owner?: string - - [k: string]: string | HardwareManufacturer | DeviceModel | FirmwareManufacturer | boolean | string[] | null | undefined -} + id: string + type: DeviceType + identifier: string + key: string + name: string | null + comment: string | null + enabled: boolean + hardware_manufacturer: HardwareManufacturer | string + hardware_model: DeviceModel | string + hardware_version: string | null + hardware_mac_address: string | null + firmware_manufacturer: FirmwareManufacturer | string + firmware_version: string | null + connector: string + owner: string | null -export interface DeviceConnectorEntity { - id: string - type: ConnectorType - address?: number | null - max_packet_length?: number | null - description_support?: boolean - settings_support?: boolean - configured_key_length?: number | null - username?: string | null - connector: string - device: string - - [k: string]: string | number | string[] | ConnectorType | boolean | null | undefined + [k: string]: string | boolean | DeviceType | HardwareManufacturer | DeviceModel | FirmwareManufacturer | null | undefined } export interface DevicePropertyEntity { - id: string - type: PropertyType - identifier: string - key: string - name: string | null - settable: boolean - queryable: boolean - data_type: DataType | null - unit: string | null - format: string[] | ((string | null)[])[] | (number | null)[] | null - invalid: string | number | null - number_of_decimals: number | null - value?: string | number | boolean | null - actual_value?: string | number | boolean | ButtonPayload | SwitchPayload | null - expected_value?: string | number | boolean | ButtonPayload | SwitchPayload | null - previous_value?: string | number | boolean | ButtonPayload | SwitchPayload | null - pending?: boolean - device: string - owner?: string - - [k: string]: string | boolean | number | string[] | ((string | null)[])[] | (number | null)[] | DataType | ButtonPayload | SwitchPayload | null | undefined + id: string + type: PropertyType + identifier: string + key: string + name: string | null + settable: boolean + queryable: boolean + data_type: DataType | null + unit: string | null + format: string[] | ((string | null)[])[] | (number | null)[] | null + invalid: string | number | null + number_of_decimals: number | null + value?: string | number | boolean | null + actual_value?: string | number | boolean | ButtonPayload | SwitchPayload | null + expected_value?: string | number | boolean | ButtonPayload | SwitchPayload | null + previous_value?: string | number | boolean | ButtonPayload | SwitchPayload | null + pending?: boolean + device: string + owner: string | null + + [k: string]: string | boolean | number | string[] | ((string | null)[])[] | (number | null)[] | DataType | ButtonPayload | SwitchPayload | null | undefined } export interface DeviceConfigurationEntity { - id: string - identifier: string - key: string - name: string | null - comment: string | null - data_type: DataType - default: string | number | null - value: string | number | null - values?: (string | number | boolean)[] - min?: number | null - max?: number | null - step?: number | null - device: string - owner?: string - - [k: string]: string | number | (string | number | boolean)[] | DataType | null | undefined + id: string + identifier: string + key: string + name: string | null + comment: string | null + data_type: DataType + default: string | number | null + value: string | number | null + values?: (string | number | boolean)[] + min?: number | null + max?: number | null + step?: number | null + device: string + owner: string | null + + [k: string]: string | number | (string | number | boolean)[] | DataType | null | undefined } export interface DeviceControlEntity { - id: string - name: string - device: string - owner?: string + id: string + name: string + device: string + owner: string | null - [k: string]: string | undefined + [k: string]: string | null } export interface ChannelEntity { - id: string - identifier: string - key: string - name: string | null - comment: string | null - control: string[] - device: string - owner?: string - - [k: string]: string | string[] | null | undefined + id: string + identifier: string + key: string + name: string | null + comment: string | null + device: string + owner: string | null + + [k: string]: string | null } export interface ChannelPropertyEntity { - id: string - type: PropertyType - identifier: string - key: string - name: string | null - settable: boolean - queryable: boolean - data_type: DataType | null - unit: string | null - format: string[] | ((string | null)[])[] | (number | null)[] | null - invalid: string | number | null - number_of_decimals: number | null - value?: string | number | boolean | null - actual_value?: string | number | boolean | ButtonPayload | SwitchPayload | null - expected_value?: string | number | boolean | ButtonPayload | SwitchPayload | null - previous_value?: string | number | boolean | ButtonPayload | SwitchPayload | null - pending?: boolean - channel: string - owner?: string - - [k: string]: string | boolean | number | string[] | ((string | null)[])[] | (number | null)[] | DataType | ButtonPayload | SwitchPayload | null | undefined + id: string + type: PropertyType + identifier: string + key: string + name: string | null + settable: boolean + queryable: boolean + data_type: DataType | null + unit: string | null + format: string[] | ((string | null)[])[] | (number | null)[] | null + invalid: string | number | null + number_of_decimals: number | null + value?: string | number | boolean | null + actual_value?: string | number | boolean | ButtonPayload | SwitchPayload | null + expected_value?: string | number | boolean | ButtonPayload | SwitchPayload | null + previous_value?: string | number | boolean | ButtonPayload | SwitchPayload | null + pending?: boolean + channel: string + owner: string | null + + [k: string]: string | boolean | number | string[] | ((string | null)[])[] | (number | null)[] | DataType | ButtonPayload | SwitchPayload | null | undefined } export interface ChannelConfigurationEntity { - id: string - identifier: string - key: string - name: string | null - comment: string | null - data_type: DataType - default: string | number | null - value: string | number | null - values?: (string | number | boolean)[] - min?: number | null - max?: number | null - step?: number | null - channel: string - owner?: string - - [k: string]: string | number | (string | number | boolean)[] | DataType | null | undefined + id: string + identifier: string + key: string + name: string | null + comment: string | null + data_type: DataType + default: string | number | null + value: string | number | null + values?: (string | number | boolean)[] + min?: number | null + max?: number | null + step?: number | null + channel: string + owner: string | null + + [k: string]: string | number | (string | number | boolean)[] | DataType | null | undefined } export interface ChannelControlEntity { - id: string - name: string - channel: string - owner?: string - - [k: string]: string | undefined -} - -export interface ConnectorControlData { - control: string - expected_value?: - | null - | string - | number - | boolean - connector: string - - [k: string]: string | number | boolean | null | undefined -} - -export interface DeviceControlData { - control: string - expected_value?: - | null - | string - | number - | boolean - device: string - - [k: string]: string | number | boolean | null | undefined -} - -export interface DevicePropertyData { - device: string - property: string - expected_value: string | number | boolean | ButtonPayload | SwitchPayload - - [k: string]: string | number | boolean | ButtonPayload | SwitchPayload | undefined -} - -export interface ChannelControlData { - control: string - expected_value?: - | null - | string - | number - | boolean - device: string - channel: string - - [k: string]: string | number | boolean | null | undefined -} - -export interface ChannelPropertyData { - device: string - channel: string - property: string - expected_value: string | number | boolean | ButtonPayload | SwitchPayload + id: string + name: string + channel: string + owner: string | null - [k: string]: string | number | boolean | ButtonPayload | SwitchPayload |undefined + [k: string]: string | null } diff --git a/public/lib/types/routing.ts b/public/lib/types/routing.ts index 6f9659b..af72ec7 100644 --- a/public/lib/types/routing.ts +++ b/public/lib/types/routing.ts @@ -1,118 +1,132 @@ +export enum GlobalRoutes { + DEVICES_PROPERTIES_DATA = 'fb.bus.data.device.property', + DEVICES_CONFIGURATION_DATA = 'fb.bus.data.device.configuration', + DEVICES_CONTROL_DATA = 'fb.bus.data.device.control', + CHANNELS_PROPERTIES_DATA = 'fb.bus.data.channel.property', + CHANNELS_CONFIGURATION_DATA = 'fb.bus.data.channel.configuration', + CHANNELS_CONTROL_DATA = 'fb.bus.data.channel.control', + CONNECTORS_CONTROL_DATA = 'fb.bus.data.connector.control', + TRIGGERS_CONTROL_DATA = 'fb.bus.data.trigger.control', +} + export enum AccountsModuleRoutes { - // Accounts - ACCOUNTS_ENTITY_CREATED = 'fb.bus.entity.created.account', - ACCOUNTS_ENTITY_UPDATED = 'fb.bus.entity.updated.account', - ACCOUNTS_ENTITY_DELETED = 'fb.bus.entity.deleted.account', - - // Emails - EMAILS_ENTITY_CREATED = 'fb.bus.entity.created.email', - EMAILS_ENTITY_UPDATED = 'fb.bus.entity.updated.email', - EMAILS_ENTITY_DELETED = 'fb.bus.entity.deleted.email', - - // Identities - IDENTITIES_ENTITY_CREATED = 'fb.bus.entity.created.identity', - IDENTITIES_ENTITY_UPDATED = 'fb.bus.entity.updated.identity', - IDENTITIES_ENTITY_DELETED = 'fb.bus.entity.deleted.identity', - - // Roles - ROLES_ENTITY_CREATED = 'fb.bus.entity.created.role', - ROLES_ENTITY_UPDATED = 'fb.bus.entity.updated.role', - ROLES_ENTITY_DELETED = 'fb.bus.entity.deleted.role', + // Accounts + ACCOUNTS_ENTITY_REPORTED = 'fb.bus.entity.created.account', + ACCOUNTS_ENTITY_CREATED = 'fb.bus.entity.created.account', + ACCOUNTS_ENTITY_UPDATED = 'fb.bus.entity.updated.account', + ACCOUNTS_ENTITY_DELETED = 'fb.bus.entity.deleted.account', + + // Emails + EMAILS_ENTITY_REPORTED = 'fb.bus.entity.created.email', + EMAILS_ENTITY_CREATED = 'fb.bus.entity.created.email', + EMAILS_ENTITY_UPDATED = 'fb.bus.entity.updated.email', + EMAILS_ENTITY_DELETED = 'fb.bus.entity.deleted.email', + + // Identities + IDENTITIES_ENTITY_REPORTED = 'fb.bus.entity.created.identity', + IDENTITIES_ENTITY_CREATED = 'fb.bus.entity.created.identity', + IDENTITIES_ENTITY_UPDATED = 'fb.bus.entity.updated.identity', + IDENTITIES_ENTITY_DELETED = 'fb.bus.entity.deleted.identity', + + // Roles + ROLES_ENTITY_REPORTED = 'fb.bus.entity.created.role', + ROLES_ENTITY_CREATED = 'fb.bus.entity.created.role', + ROLES_ENTITY_UPDATED = 'fb.bus.entity.updated.role', + ROLES_ENTITY_DELETED = 'fb.bus.entity.deleted.role', } export enum DevicesModuleRoutes { - // Devices - DEVICES_ENTITY_CREATED = 'fb.bus.entity.created.device', - DEVICES_ENTITY_UPDATED = 'fb.bus.entity.updated.device', - DEVICES_ENTITY_DELETED = 'fb.bus.entity.deleted.device', - - // Devices properties - DEVICES_PROPERTY_ENTITY_CREATED = 'fb.bus.entity.created.device.property', - DEVICES_PROPERTY_ENTITY_UPDATED = 'fb.bus.entity.updated.device.property', - DEVICES_PROPERTY_ENTITY_DELETED = 'fb.bus.entity.deleted.device.property', - - DEVICES_PROPERTIES_DATA = 'fb.bus.data.device.property', - - // Devices configuration - DEVICES_CONFIGURATION_ENTITY_CREATED = 'fb.bus.entity.created.device.configuration', - DEVICES_CONFIGURATION_ENTITY_UPDATED = 'fb.bus.entity.updated.device.configuration', - DEVICES_CONFIGURATION_ENTITY_DELETED = 'fb.bus.entity.deleted.device.configuration', - - DEVICES_CONFIGURATION_DATA = 'fb.bus.data.device.configuration', - - // Devices control - DEVICES_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.device.control', - DEVICES_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.device.control', - DEVICES_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.device.control', - - DEVICES_CONTROL_DATA = 'fb.bus.data.device.control', - - // Channels - CHANNELS_ENTITY_CREATED = 'fb.bus.entity.created.channel', - CHANNELS_ENTITY_UPDATED = 'fb.bus.entity.updated.channel', - CHANNELS_ENTITY_DELETED = 'fb.bus.entity.deleted.channel', - - // Channels properties - CHANNELS_PROPERTY_ENTITY_CREATED = 'fb.bus.entity.created.channel.property', - CHANNELS_PROPERTY_ENTITY_UPDATED = 'fb.bus.entity.updated.channel.property', - CHANNELS_PROPERTY_ENTITY_DELETED = 'fb.bus.entity.deleted.channel.property', - - CHANNELS_PROPERTIES_DATA = 'fb.bus.data.channel.property', - - // Channels configuration - CHANNELS_CONFIGURATION_ENTITY_CREATED = 'fb.bus.entity.created.channel.configuration', - CHANNELS_CONFIGURATION_ENTITY_UPDATED = 'fb.bus.entity.updated.channel.configuration', - CHANNELS_CONFIGURATION_ENTITY_DELETED = 'fb.bus.entity.deleted.channel.configuration', - - CHANNELS_CONFIGURATION_DATA = 'fb.bus.data.channel.configuration', - - // Channels control - CHANNELS_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.channel.control', - CHANNELS_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.channel.control', - CHANNELS_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.channel.control', - - CHANNELS_CONTROL_DATA = 'fb.bus.data.channel.control', - - // Connectors configuration - CONNECTORS_ENTITY_CREATED = 'fb.bus.entity.created.connector', - CONNECTORS_ENTITY_UPDATED = 'fb.bus.entity.updated.connector', - CONNECTORS_ENTITY_DELETED = 'fb.bus.entity.deleted.connector', - - // Connectors control - CONNECTORS_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.connector.control', - CONNECTORS_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.connector.control', - CONNECTORS_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.connector.control', - - CONNECTORS_CONTROL_DATA = 'fb.bus.data.connector.control', + // Devices + DEVICES_ENTITY_REPORTED = 'fb.bus.entity.created.device', + DEVICES_ENTITY_CREATED = 'fb.bus.entity.created.device', + DEVICES_ENTITY_UPDATED = 'fb.bus.entity.updated.device', + DEVICES_ENTITY_DELETED = 'fb.bus.entity.deleted.device', + + // Devices properties + DEVICES_PROPERTY_ENTITY_REPORTED = 'fb.bus.entity.created.device.property', + DEVICES_PROPERTY_ENTITY_CREATED = 'fb.bus.entity.created.device.property', + DEVICES_PROPERTY_ENTITY_UPDATED = 'fb.bus.entity.updated.device.property', + DEVICES_PROPERTY_ENTITY_DELETED = 'fb.bus.entity.deleted.device.property', + + // Devices configuration + DEVICES_CONFIGURATION_ENTITY_REPORTED = 'fb.bus.entity.created.device.configuration', + DEVICES_CONFIGURATION_ENTITY_CREATED = 'fb.bus.entity.created.device.configuration', + DEVICES_CONFIGURATION_ENTITY_UPDATED = 'fb.bus.entity.updated.device.configuration', + DEVICES_CONFIGURATION_ENTITY_DELETED = 'fb.bus.entity.deleted.device.configuration', + + // Devices control + DEVICES_CONTROL_ENTITY_REPORTED = 'fb.bus.entity.created.device.control', + DEVICES_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.device.control', + DEVICES_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.device.control', + DEVICES_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.device.control', + + // Channels + CHANNELS_ENTITY_REPORTED = 'fb.bus.entity.created.channel', + CHANNELS_ENTITY_CREATED = 'fb.bus.entity.created.channel', + CHANNELS_ENTITY_UPDATED = 'fb.bus.entity.updated.channel', + CHANNELS_ENTITY_DELETED = 'fb.bus.entity.deleted.channel', + + // Channels properties + CHANNELS_PROPERTY_ENTITY_REPORTED = 'fb.bus.entity.created.channel.property', + CHANNELS_PROPERTY_ENTITY_CREATED = 'fb.bus.entity.created.channel.property', + CHANNELS_PROPERTY_ENTITY_UPDATED = 'fb.bus.entity.updated.channel.property', + CHANNELS_PROPERTY_ENTITY_DELETED = 'fb.bus.entity.deleted.channel.property', + + // Channels configuration + CHANNELS_CONFIGURATION_ENTITY_REPORTED = 'fb.bus.entity.created.channel.configuration', + CHANNELS_CONFIGURATION_ENTITY_CREATED = 'fb.bus.entity.created.channel.configuration', + CHANNELS_CONFIGURATION_ENTITY_UPDATED = 'fb.bus.entity.updated.channel.configuration', + CHANNELS_CONFIGURATION_ENTITY_DELETED = 'fb.bus.entity.deleted.channel.configuration', + + // Channels control + CHANNELS_CONTROL_ENTITY_REPORTED = 'fb.bus.entity.created.channel.control', + CHANNELS_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.channel.control', + CHANNELS_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.channel.control', + CHANNELS_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.channel.control', + + // Connectors configuration + CONNECTORS_ENTITY_REPORTED = 'fb.bus.entity.created.connector', + CONNECTORS_ENTITY_CREATED = 'fb.bus.entity.created.connector', + CONNECTORS_ENTITY_UPDATED = 'fb.bus.entity.updated.connector', + CONNECTORS_ENTITY_DELETED = 'fb.bus.entity.deleted.connector', + + // Connectors control + CONNECTORS_CONTROL_ENTITY_REPORTED = 'fb.bus.entity.created.connector.control', + CONNECTORS_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.connector.control', + CONNECTORS_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.connector.control', + CONNECTORS_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.connector.control', } export enum TriggersModuleRoutes { - // Triggers - TRIGGERS_ENTITY_CREATED = 'fb.bus.entity.created.trigger', - TRIGGERS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger', - TRIGGERS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger', - - // Connectors control - TRIGGERS_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.trigger.control', - TRIGGERS_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.control', - TRIGGERS_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.control', - - TRIGGERS_CONTROL_DATA = 'fb.bus.data.trigger.control', - - // Triggers actions - TRIGGERS_ACTIONS_ENTITY_CREATED = 'fb.bus.entity.created.trigger.action', - TRIGGERS_ACTIONS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.action', - TRIGGERS_ACTIONS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.action', - - // Triggers notifications - TRIGGERS_NOTIFICATIONS_ENTITY_CREATED = 'fb.bus.entity.created.trigger.notification', - TRIGGERS_NOTIFICATIONS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.notification', - TRIGGERS_NOTIFICATIONS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.notification', - - // Triggers conditions - TRIGGERS_CONDITIONS_ENTITY_CREATED = 'fb.bus.entity.created.trigger.condition', - TRIGGERS_CONDITIONS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.condition', - TRIGGERS_CONDITIONS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.condition', + // Triggers + TRIGGERS_ENTITY_REPORTED = 'fb.bus.entity.created.trigger', + TRIGGERS_ENTITY_CREATED = 'fb.bus.entity.created.trigger', + TRIGGERS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger', + TRIGGERS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger', + + // Connectors control + TRIGGERS_CONTROL_ENTITY_REPORTED = 'fb.bus.entity.created.trigger.control', + TRIGGERS_CONTROL_ENTITY_CREATED = 'fb.bus.entity.created.trigger.control', + TRIGGERS_CONTROL_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.control', + TRIGGERS_CONTROL_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.control', + + // Triggers actions + TRIGGERS_ACTIONS_ENTITY_REPORTED = 'fb.bus.entity.created.trigger.action', + TRIGGERS_ACTIONS_ENTITY_CREATED = 'fb.bus.entity.created.trigger.action', + TRIGGERS_ACTIONS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.action', + TRIGGERS_ACTIONS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.action', + + // Triggers notifications + TRIGGERS_NOTIFICATIONS_ENTITY_REPORTED = 'fb.bus.entity.created.trigger.notification', + TRIGGERS_NOTIFICATIONS_ENTITY_CREATED = 'fb.bus.entity.created.trigger.notification', + TRIGGERS_NOTIFICATIONS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.notification', + TRIGGERS_NOTIFICATIONS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.notification', + + // Triggers conditions + TRIGGERS_CONDITIONS_ENTITY_REPORTED = 'fb.bus.entity.created.trigger.condition', + TRIGGERS_CONDITIONS_ENTITY_CREATED = 'fb.bus.entity.created.trigger.condition', + TRIGGERS_CONDITIONS_ENTITY_UPDATED = 'fb.bus.entity.updated.trigger.condition', + TRIGGERS_CONDITIONS_ENTITY_DELETED = 'fb.bus.entity.deleted.trigger.condition', } export enum UiModuleRoutes { diff --git a/public/lib/types/triggers-module.ts b/public/lib/types/triggers-module.ts index 0312330..60ae331 100644 --- a/public/lib/types/triggers-module.ts +++ b/public/lib/types/triggers-module.ts @@ -1,108 +1,95 @@ export enum TriggerType { - MANUAL = 'manual', - AUTOMATIC = 'automatic', + MANUAL = 'manual', + AUTOMATIC = 'automatic', } -export enum TriggerActionType { - DEVICE_PROPERTY = 'device-property', - CHANNEL_PROPERTY = 'channel-property', +export enum ActionType { + DEVICE_PROPERTY = 'device-property', + CHANNEL_PROPERTY = 'channel-property', } -export enum TriggerConditionType { - CHANNEL_PROPERTY = 'channel-property', - DEVICE_PROPERTY = 'device-property', - TIME = 'time', - DATE = 'date', +export enum ConditionType { + CHANNEL_PROPERTY = 'channel-property', + DEVICE_PROPERTY = 'device-property', + TIME = 'time', + DATE = 'date', } -export enum TriggerNotificationType { - EMAIL = 'email', - SMS = 'sms', +export enum NotificationType { + EMAIL = 'email', + SMS = 'sms', } -export enum TriggerConditionOperator { - EQUAL = 'eq', - ABOVE = 'above', - BELOW = 'below', +export enum ConditionOperator { + EQUAL = 'eq', + ABOVE = 'above', + BELOW = 'below', } export interface TriggerEntity { - id: string - type: TriggerType - name: string - comment: string | null - enabled: boolean - control?: string[] - owner?: string - is_triggered?: boolean | null - is_fulfilled?: boolean | null + id: string + type: TriggerType + name: string + comment: string | null + enabled: boolean + owner: string | null + is_triggered?: boolean | null + is_fulfilled?: boolean | null - [k: string]: string | TriggerType | boolean | string[] | null | undefined + [k: string]: string | TriggerType | boolean | null | undefined } export interface TriggerControlEntity { id: string name: string trigger: string - owner?: string + owner: string | null - [k: string]: string | undefined + [k: string]: string | null } export interface ActionEntity { - id: string - type: TriggerActionType - enabled: boolean - trigger: string - device?: string - channel?: string - property?: string - value?: string - owner?: string - is_triggered?: boolean | null - - [k: string]: string | TriggerActionType | boolean | null | undefined + id: string + type: ActionType + enabled: boolean + trigger: string + device?: string + channel?: string + property?: string + value?: string + owner: string | null + is_triggered?: boolean | null + + [k: string]: string | ActionType | boolean | null | undefined } export interface ConditionEntity { - id: string - type: TriggerConditionType - enabled: boolean - trigger: string - device?: string - channel?: string - property?: string - operand?: string - operator?: TriggerConditionOperator - time?: string - days?: number[] - date?: string - owner?: string - is_fulfilled?: boolean | null - - [k: string]: string | TriggerConditionType | TriggerConditionOperator | boolean | number[] | null | undefined + id: string + type: ConditionType + enabled: boolean + trigger: string + device?: string + channel?: string + property?: string + operand?: string + operator?: ConditionOperator + time?: string + days?: number[] + date?: string + owner: string | null + is_fulfilled?: boolean | null + + [k: string]: string | ConditionType | ConditionOperator | boolean | number[] | null | undefined } export interface NotificationEntity { - id: string - type: TriggerNotificationType - enabled: boolean - trigger: string - email?: string - phone?: string - owner?: string - - [k: string]: string | TriggerNotificationType | boolean | undefined -} - -export interface TriggerControlData { - control: string - expected_value?: - | null - | string - | number - | boolean - trigger: string + id: string + type: NotificationType + enabled: boolean + trigger: string + email?: string + phone?: string + owner: string | null - [k: string]: string | number | boolean | null | undefined + [k: string]: string | NotificationType | boolean | null | undefined } diff --git a/public/lib/types/types.ts b/public/lib/types/types.ts index 490bc96..f71e598 100644 --- a/public/lib/types/types.ts +++ b/public/lib/types/types.ts @@ -1,52 +1,67 @@ export enum ModuleOrigin { - NOT_SPECIFIED = '*', - MODULE_ACCOUNTS = 'com.fastybird.accounts-module', - MODULE_DEVICES = 'com.fastybird.devices-module', - MODULE_TRIGGERS = 'com.fastybird.triggers-module', - MODULE_UI = 'com.fastybird.ui-module', - MODULE_WEB_UI = 'com.fastybird.web-ui-module', + NOT_SPECIFIED = '*', + MODULE_ACCOUNTS = 'com.fastybird.accounts-module', + MODULE_DEVICES = 'com.fastybird.devices-module', + MODULE_TRIGGERS = 'com.fastybird.triggers-module', + MODULE_UI = 'com.fastybird.ui-module', + MODULE_WEB_UI = 'com.fastybird.web-ui-module', } export enum ModulePrefix { - MODULE_ACCOUNTS = 'accounts-module', - MODULE_DEVICES = 'devices-module', - MODULE_TRIGGERS = 'triggers-module', - MODULE_UI = 'ui-module', + MODULE_ACCOUNTS = 'accounts-module', + MODULE_DEVICES = 'devices-module', + MODULE_TRIGGERS = 'triggers-module', + MODULE_UI = 'ui-module', +} + +export enum PluginOrigin { + NOT_SPECIFIED = '*', + FB_BUS_CONNECTOR_PLUGIN = 'com.fastybird.fb-bus-connector-plugin', + FB_MQTT_CONNECTOR_PLUGIN = 'com.fastybird.fb-mqtt-connector-plugin', + SHELLY_CONNECTOR_PLUGIN = 'com.fastybird.shelly-connector-plugin', + TUYA_CONNECTOR_PLUGIN = 'com.fastybird.tuya-connector-plugin', + SONOFF_CONNECTOR_PLUGIN = 'com.fastybird.sonoff-connector-plugin', + MODBUS_CONNECTOR_PLUGIN = 'com.fastybird.modbus-connector-plugin', + WS_EXCHANGE_PLUGIN = 'com.fastybird.ws-exchange-plugin', + REDISDB_EXCHANGE_PLUGIN = 'com.fastybird.redisdb-exchange-plugin', + RABBITMQ_EXCHANGE_PLUGIN = 'com.fastybird.rabbitmq-exchange-plugin', + REDISDB_STORAGE_PLUGIN = 'com.fastybird.redisdb-storage-plugin', + COUCHDB_STORAGE_PLUGIN = 'com.fastybird.couchdb-storage-plugin', } export enum DataType { - CHAR = 'char', - UCHAR = 'uchar', - SHORT = 'short', - USHORT = 'ushort', - INT = 'int', - UINT = 'uint', - FLOAT = 'float', - BOOLEAN = 'bool', - STRING = 'string', - ENUM = 'enum', - DATE = 'date', - TIME = 'time', - DATETIME = 'datetime', - COLOR = 'color', - BUTTON = 'button', - SWITCH = 'switch', + CHAR = 'char', + UCHAR = 'uchar', + SHORT = 'short', + USHORT = 'ushort', + INT = 'int', + UINT = 'uint', + FLOAT = 'float', + BOOLEAN = 'bool', + STRING = 'string', + ENUM = 'enum', + DATE = 'date', + TIME = 'time', + DATETIME = 'datetime', + COLOR = 'color', + BUTTON = 'button', + SWITCH = 'switch', } export enum SwitchPayload { - ON = 'switch-on', - OFF = 'switch-off', - TOGGLE = 'switch-toggle', + ON = 'switch-on', + OFF = 'switch-off', + TOGGLE = 'switch-toggle', } export enum ButtonPayload { - PRESSED = 'btn-pressed', - RELEASED = 'btn-released', - CLICKED = 'btn-clicked', - DOUBLE_CLICKED = 'btn-double-clicked', - TRIPLE_CLICKED = 'btn-triple-clicked', - LONG_CLICKED = 'btn-long-clicked', - EXTRA_LONG_CLICKED = 'btn-extra-long-clicked', + PRESSED = 'btn-pressed', + RELEASED = 'btn-released', + CLICKED = 'btn-clicked', + DOUBLE_CLICKED = 'btn-double-clicked', + TRIPLE_CLICKED = 'btn-triple-clicked', + LONG_CLICKED = 'btn-long-clicked', + EXTRA_LONG_CLICKED = 'btn-extra-long-clicked', } export enum ControlName { @@ -55,3 +70,13 @@ export enum ControlName { REBOOT = 'reboot', TRIGGER = 'trigger', } + +export enum PropertyAction { + SET = 'set', + GET = 'get', + REPORT = 'report', +} + +export enum ControlAction { + SET = 'set', +} diff --git a/public/types/modules-metadata.ts b/public/types/modules-metadata.ts index 5a137e6..a593e09 100644 --- a/public/types/modules-metadata.ts +++ b/public/types/modules-metadata.ts @@ -1,6 +1,7 @@ // Re-export library types export * from '@/lib/types/types' export * from '@/lib/types/routing' +export * from '@/lib/types/data' export * from '@/lib/types/accounts-module' export * from '@/lib/types/devices-module' export * from '@/lib/types/triggers-module' diff --git a/resources/schemas/accounts-module/entity.account.json b/resources/schemas/accounts-module/entity.account.json index 7cbcada..bbbe0be 100644 --- a/resources/schemas/accounts-module/entity.account.json +++ b/resources/schemas/accounts-module/entity.account.json @@ -1,21 +1,21 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] } }, - "state" : { - "type" : "string", - "enum" : [ + "state": { + "type": "string", + "enum": [ "active", "blocked", "deleted", @@ -24,59 +24,59 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "first_name" : { - "type" : "string" + "first_name": { + "type": "string" }, - "last_name" : { - "type" : "string" + "last_name": { + "type": "string" }, - "middle_name" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "middle_name": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "email" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "email": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "language" : { - "type" : "string" + "language": { + "type": "string" }, - "state" : { - "$ref" : "#/definitions/state" + "state": { + "$ref": "#/definitions/state" }, - "registered" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "registered": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "last_visit" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "last_visit": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "roles" : { - "type" : "array", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string" + "roles": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string" } } }, - "required" : [ + "required": [ "id", - "type", - "state", - "registered", - "last_visit", "first_name", "last_name", "middle_name", + "state", + "registered", + "last_visit", "email", - "language" + "language", + "roles" ] } diff --git a/resources/schemas/accounts-module/entity.email.json b/resources/schemas/accounts-module/entity.email.json index a85c89c..f7253ca 100644 --- a/resources/schemas/accounts-module/entity.email.json +++ b/resources/schemas/accounts-module/entity.email.json @@ -1,37 +1,37 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "address" : { - "type" : "string", - "description" : "Email address like: john@doe.com" + "address": { + "type": "string", + "description": "Email address like: john@doe.com" }, - "default" : { - "type" : "boolean", - "default" : false + "default": { + "type": "boolean", + "default": false }, - "verified" : { - "type" : "boolean", - "default" : false + "verified": { + "type": "boolean", + "default": false }, - "private" : { - "type" : "boolean", - "default" : false + "private": { + "type": "boolean", + "default": false }, - "public" : { - "type" : "boolean", - "default" : false + "public": { + "type": "boolean", + "default": false }, - "account" : { + "account": { "type": "string", "description": "Account unique uuid v4 identifier used across services" } }, - "required" : [ + "required": [ "id", "address", "default", diff --git a/resources/schemas/accounts-module/entity.identity.json b/resources/schemas/accounts-module/entity.identity.json index b7cf14f..967caa0 100644 --- a/resources/schemas/accounts-module/entity.identity.json +++ b/resources/schemas/accounts-module/entity.identity.json @@ -1,9 +1,9 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "state" : { - "type" : "string", - "enum" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "state": { + "type": "string", + "enum": [ "active", "blocked", "deleted", @@ -11,27 +11,27 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "state" : { - "$ref" : "#/definitions/state" + "state": { + "$ref": "#/definitions/state" }, - "uid" : { - "type" : "string" + "uid": { + "type": "string" }, - "password" : { - "type" : "string" + "password": { + "type": "string" }, - "account" : { + "account": { "type": "string", "description": "Account unique uuid v4 identifier used across services" } }, - "required" : [ + "required": [ "id", "state", "uid", diff --git a/resources/schemas/accounts-module/entity.role.json b/resources/schemas/accounts-module/entity.role.json index a6dcf9a..122ff39 100644 --- a/resources/schemas/accounts-module/entity.role.json +++ b/resources/schemas/accounts-module/entity.role.json @@ -1,6 +1,6 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { "types": { "nullable_string": { "oneOf": [ @@ -14,37 +14,37 @@ } } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "name" : { - "type" : "string" + "name": { + "type": "string" }, - "description" : { - "type" : "string" + "description": { + "type": "string" }, - "anonymous" : { - "type" : "boolean", - "default" : false + "anonymous": { + "type": "boolean", + "default": false }, - "authenticated" : { - "type" : "boolean", - "default" : false + "authenticated": { + "type": "boolean", + "default": false }, - "administrator" : { - "type" : "boolean", - "default" : false + "administrator": { + "type": "boolean", + "default": false }, - "parent" : { - "$ref" : "#/definitions/types/nullable_string", + "parent": { + "$ref": "#/definitions/types/nullable_string", "description": "Parent role unique uuid v4 identifier used across services", - "default" : null + "default": null } }, - "required" : [ + "required": [ "id", "name", "description", diff --git a/resources/schemas/data/data.channel.control.json b/resources/schemas/data/data.channel.control.json index 3346f6f..86ba10b 100644 --- a/resources/schemas/data/data.channel.control.json +++ b/resources/schemas/data/data.channel.control.json @@ -1,44 +1,54 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string_number_boolean" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string_number_boolean": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" } ] } + }, + "action": { + "type": "string", + "enum": [ + "set" + ] } }, - "type" : "object", - "properties" : { - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/action" + }, + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" }, - "channel" : { - "type" : "string", - "description" : "Channel unique uuid v4 identifier used across services" + "channel": { + "type": "string", + "description": "Channel unique uuid v4 identifier used across services" }, - "control" : { - "type" : "string", - "description" : "Control unique uuid v4 identifier used across services" + "control": { + "type": "string", + "description": "Control unique uuid v4 identifier used across services" }, - "expected_value" : { - "$ref" : "#/definitions/types/nullable_string_number_boolean" + "expected_value": { + "$ref": "#/definitions/types/nullable_string_number_boolean" } }, - "required" : [ + "required": [ + "action", "device", "channel", "control" diff --git a/resources/schemas/data/data.channel.property.json b/resources/schemas/data/data.channel.property.json index e239e05..b82b87e 100644 --- a/resources/schemas/data/data.channel.property.json +++ b/resources/schemas/data/data.channel.property.json @@ -1,44 +1,112 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "string_number_boolean" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "string_number_boolean": { + "oneOf": [ { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" } ] } + }, + "action": { + "type": "string", + "enum": [ + "get", + "set", + "report" + ] } }, - "type" : "object", - "properties" : { - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/action" }, - "channel" : { - "type" : "string", - "description" : "Channel unique uuid v4 identifier used across services" + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" }, - "property" : { - "type" : "string", - "description" : "Property unique uuid v4 identifier used across services" + "channel": { + "type": "string", + "description": "Channel unique uuid v4 identifier used across services" }, - "expected_value" : { - "$ref" : "#/definitions/types/string_number_boolean" + "property": { + "type": "string", + "description": "Property unique uuid v4 identifier used across services" + } + }, + "if": { + "properties": { + "action": { + "const": "get" + } } }, - "required" : [ - "device", - "channel", - "property", - "expected_value" - ] + "then": { + "required": [ + "action", + "device", + "channel", + "property" + ] + }, + "else": { + "if": { + "properties": { + "action": { + "const": "set" + } + } + }, + "then": { + "properties": { + "expected_value": { + "$ref": "#/definitions/types/string_number_boolean", + "description": "Property value to be written into device" + } + }, + "required": [ + "action", + "device", + "channel", + "property", + "expected_value" + ] + }, + "else": { + "if": { + "properties": { + "action": { + "const": "report" + } + } + }, + "then": { + "properties": { + "actual_value": { + "$ref": "#/definitions/types/string_number_boolean", + "description": "Property value stored in device" + }, + "pending": { + "type": "boolean" + } + }, + "required": [ + "action", + "device", + "channel", + "property", + "actual_value" + ] + } + } + } } diff --git a/resources/schemas/data/data.connector.control.json b/resources/schemas/data/data.connector.control.json index a90a42f..2baaac1 100644 --- a/resources/schemas/data/data.connector.control.json +++ b/resources/schemas/data/data.connector.control.json @@ -1,40 +1,50 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string_number_boolean" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string_number_boolean": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" } ] } + }, + "action": { + "type": "string", + "enum": [ + "set" + ] } }, - "type" : "object", - "properties" : { - "connector" : { - "type" : "string", - "description" : "Connector unique uuid v4 identifier used across services" + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/action" + }, + "connector": { + "type": "string", + "description": "Connector unique uuid v4 identifier used across services" }, - "control" : { - "type" : "string", - "description" : "Control unique uuid v4 identifier used across services" + "control": { + "type": "string", + "description": "Control unique uuid v4 identifier used across services" }, - "expected_value" : { - "$ref" : "#/definitions/types/nullable_string_number_boolean" + "expected_value": { + "$ref": "#/definitions/types/nullable_string_number_boolean" } }, - "required" : [ + "required": [ + "action", "connector", "control" ] diff --git a/resources/schemas/data/data.device.control.json b/resources/schemas/data/data.device.control.json index fa33652..893ffec 100644 --- a/resources/schemas/data/data.device.control.json +++ b/resources/schemas/data/data.device.control.json @@ -1,40 +1,50 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string_number_boolean" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string_number_boolean": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" } ] } + }, + "action": { + "type": "string", + "enum": [ + "set" + ] } }, - "type" : "object", - "properties" : { - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/action" + }, + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" }, - "control" : { - "type" : "string", - "description" : "Control unique uuid v4 identifier used across services" + "control": { + "type": "string", + "description": "Control unique uuid v4 identifier used across services" }, - "expected_value" : { - "$ref" : "#/definitions/types/nullable_string_number_boolean" + "expected_value": { + "$ref": "#/definitions/types/nullable_string_number_boolean" } }, - "required" : [ + "required": [ + "action", "device", "control" ] diff --git a/resources/schemas/data/data.device.property.json b/resources/schemas/data/data.device.property.json index 6751a04..8624843 100644 --- a/resources/schemas/data/data.device.property.json +++ b/resources/schemas/data/data.device.property.json @@ -1,39 +1,105 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "string_number_boolean" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "string_number_boolean": { + "oneOf": [ { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" } ] } + }, + "action": { + "type": "string", + "enum": [ + "get", + "set", + "report" + ] } }, - "type" : "object", - "properties" : { - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/action" }, - "property" : { - "type" : "string", - "description" : "Property unique uuid v4 identifier used across services" + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" }, - "expected_value" : { - "$ref" : "#/definitions/types/string_number_boolean" + "property": { + "type": "string", + "description": "Property unique uuid v4 identifier used across services" + } + }, + "if": { + "properties": { + "action": { + "const": "get" + } } }, - "required" : [ - "device", - "property", - "expected_value" - ] + "then": { + "required": [ + "action", + "device", + "property" + ] + }, + "else": { + "if": { + "properties": { + "action": { + "const": "set" + } + } + }, + "then": { + "properties": { + "expected_value": { + "$ref": "#/definitions/types/string_number_boolean", + "description": "Property value to be written into device" + } + }, + "required": [ + "action", + "device", + "property", + "expected_value" + ] + }, + "else": { + "if": { + "properties": { + "action": { + "const": "report" + } + } + }, + "then": { + "properties": { + "actual_value": { + "$ref": "#/definitions/types/string_number_boolean", + "description": "Property value stored in device" + }, + "pending": { + "type": "boolean" + } + }, + "required": [ + "action", + "device", + "property", + "actual_value" + ] + } + } + } } diff --git a/resources/schemas/data/data.trigger.control.json b/resources/schemas/data/data.trigger.control.json index 39c8136..c4c7161 100644 --- a/resources/schemas/data/data.trigger.control.json +++ b/resources/schemas/data/data.trigger.control.json @@ -1,40 +1,50 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string_number_boolean" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string_number_boolean": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" } ] } + }, + "action": { + "type": "string", + "enum": [ + "set" + ] } }, - "type" : "object", - "properties" : { - "trigger" : { - "type" : "string", - "description" : "Trigger unique uuid v4 identifier used across services" + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/action" + }, + "trigger": { + "type": "string", + "description": "Trigger unique uuid v4 identifier used across services" }, - "control" : { - "type" : "string", - "description" : "Control unique uuid v4 identifier used across services" + "control": { + "type": "string", + "description": "Control unique uuid v4 identifier used across services" }, - "expected_value" : { - "$ref" : "#/definitions/types/nullable_string_number_boolean" + "expected_value": { + "$ref": "#/definitions/types/nullable_string_number_boolean" } }, - "required" : [ + "required": [ + "action", "trigger", "control" ] diff --git a/resources/schemas/devices-module/entity.channel.configuration.json b/resources/schemas/devices-module/entity.channel.configuration.json index d98e3f1..8b395e3 100644 --- a/resources/schemas/devices-module/entity.channel.configuration.json +++ b/resources/schemas/devices-module/entity.channel.configuration.json @@ -1,44 +1,44 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] }, - "nullable_number" : { - "oneOf" : [ + "nullable_number": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "number" + "type": "number" } ] }, - "nullable_string_number" : { - "oneOf" : [ + "nullable_string_number": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" } ] } }, - "data_type" : { - "type" : "string", - "enum" : [ + "data_type": { + "type": "string", + "enum": [ "char", "uchar", "short", @@ -52,63 +52,63 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "identifier" : { - "type" : "string", - "description" : "Unique human readable identifier used across services" + "identifier": { + "type": "string", + "description": "Unique human readable identifier used across services" }, - "key" : { - "type" : "string", - "description" : "Unique pub/sub identifier per each entity" + "key": { + "type": "string", + "description": "Unique pub/sub identifier per each entity" }, - "name" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "name": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "comment" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "comment": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "data_type" : { - "$ref" : "#/definitions/data_type", - "default" : null + "data_type": { + "$ref": "#/definitions/data_type", + "default": null }, - "default" : { - "$ref" : "#/definitions/types/nullable_string_number", - "default" : null + "default": { + "$ref": "#/definitions/types/nullable_string_number", + "default": null }, - "value" : { - "$ref" : "#/definitions/types/nullable_string_number", - "default" : null + "value": { + "$ref": "#/definitions/types/nullable_string_number", + "default": null }, - "channel" : { - "type" : "string", - "description" : "Channel unique uuid v4 identifier used across services" + "channel": { + "type": "string", + "description": "Channel unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "data_type" : { - "const" : "enum" + "if": { + "properties": { + "data_type": { + "const": "enum" } } }, - "then" : { - "properties" : { - "values" : { - "type" : "array" + "then": { + "properties": { + "values": { + "type": "array" } }, - "required" : [ + "required": [ "id", "identifier", "key", @@ -121,11 +121,11 @@ "values" ] }, - "else" : { - "if" : { - "properties" : { - "data_type" : { - "enum" : [ + "else": { + "if": { + "properties": { + "data_type": { + "enum": [ "char", "uchar", "short", @@ -137,22 +137,22 @@ } } }, - "then" : { - "properties" : { - "min" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "then": { + "properties": { + "min": { + "$ref": "#/definitions/types/nullable_number", + "default": null }, - "max" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "max": { + "$ref": "#/definitions/types/nullable_number", + "default": null }, - "step" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "step": { + "$ref": "#/definitions/types/nullable_number", + "default": null } }, - "required" : [ + "required": [ "id", "identifier", "key", @@ -167,8 +167,8 @@ "step" ] }, - "else" : { - "required" : [ + "else": { + "required": [ "id", "identifier", "key", diff --git a/resources/schemas/devices-module/entity.channel.control.json b/resources/schemas/devices-module/entity.channel.control.json index fa9f842..21faf67 100644 --- a/resources/schemas/devices-module/entity.channel.control.json +++ b/resources/schemas/devices-module/entity.channel.control.json @@ -1,24 +1,38 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + } + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "name" : { - "type" : "string" + "name": { + "type": "string" }, - "channel" : { - "type" : "string", - "description" : "Channel unique uuid v4 identifier used across services" + "channel": { + "type": "string", + "description": "Channel unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "required" : [ + "required": [ "id", "name", "channel" diff --git a/resources/schemas/devices-module/entity.channel.json b/resources/schemas/devices-module/entity.channel.json index 2f68469..4acb2de 100644 --- a/resources/schemas/devices-module/entity.channel.json +++ b/resources/schemas/devices-module/entity.channel.json @@ -1,51 +1,51 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] } } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "identifier" : { - "type" : "string", - "description" : "Unique human readable identifier used across services" + "identifier": { + "type": "string", + "description": "Unique human readable identifier used across services" }, - "key" : { - "type" : "string", - "description" : "Unique pub/sub identifier per each entity" + "key": { + "type": "string", + "description": "Unique pub/sub identifier per each entity" }, - "name" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "name": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "comment" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "comment": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "required" : [ + "required": [ "id", "identifier", "key", diff --git a/resources/schemas/devices-module/entity.channel.property.json b/resources/schemas/devices-module/entity.channel.property.json index 8a65449..fe8e2e1 100644 --- a/resources/schemas/devices-module/entity.channel.property.json +++ b/resources/schemas/devices-module/entity.channel.property.json @@ -1,67 +1,67 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] }, - "nullable_number" : { - "oneOf" : [ + "nullable_number": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "number" + "type": "number" } ] }, - "string_number" : { - "oneOf" : [ + "string_number": { + "oneOf": [ { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" } ] }, - "nullable_data_type" : { - "oneOf" : [ + "nullable_data_type": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "$ref" : "#/definitions/datatype" + "$ref": "#/definitions/datatype" } ] }, - "nullable_format" : { - "oneOf" : [ + "nullable_format": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { "type": "array", "uniqueItems": true, "items": { - "type" : "string" + "type": "string" } }, { "type": "array", "uniqueItems": true, "items": { - "type" : "array", + "type": "array", "uniqueItems": true, "items": { - "$ref" : "#/definitions/types/nullable_string" + "$ref": "#/definitions/types/nullable_string" }, "minItems": 3, "maxItems": 3 @@ -71,53 +71,53 @@ "type": "array", "uniqueItems": true, "items": { - "$ref" : "#/definitions/types/nullable_number" + "$ref": "#/definitions/types/nullable_number" }, "minItems": 2, "maxItems": 2 } ] }, - "nullable_invalid" : { - "oneOf" : [ + "nullable_invalid": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" } ] }, - "string_number_boolean_null" : { - "oneOf" : [ + "string_number_boolean_null": { + "oneOf": [ { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" }, { - "type" : "null" + "type": "null" } ] } }, - "type" : { - "type" : "string", - "enum" : [ + "type": { + "type": "string", + "enum": [ "static", "dynamic" ] }, - "datatype" : { - "type" : "string", - "enum" : [ + "datatype": { + "type": "string", + "enum": [ "char", "uchar", "short", @@ -134,87 +134,87 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" - }, - "type" : { - "$ref" : "#/definitions/type" - }, - "identifier" : { - "type" : "string", - "description" : "Unique human readable identifier used across services" - }, - "key" : { - "type" : "string", - "description" : "Unique pub/sub identifier per each entity" - }, - "name" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null - }, - "settable" : { - "type" : "boolean", - "default" : false - }, - "queryable" : { - "type" : "boolean", - "default" : false - }, - "data_type" : { - "$ref" : "#/definitions/types/nullable_data_type", - "default" : null - }, - "unit" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null - }, - "format" : { - "$ref" : "#/definitions/types/nullable_format", - "default" : null - }, - "invalid" : { - "$ref" : "#/definitions/types/nullable_invalid", - "default" : null - }, - "number_of_decimals" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null - }, - "channel" : { - "type" : "string", - "description" : "Channel unique uuid v4 identifier used across services" - }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" + }, + "type": { + "$ref": "#/definitions/type" + }, + "identifier": { + "type": "string", + "description": "Unique human readable identifier used across services" + }, + "key": { + "type": "string", + "description": "Unique pub/sub identifier per each entity" + }, + "name": { + "$ref": "#/definitions/types/nullable_string", + "default": null + }, + "settable": { + "type": "boolean", + "default": false + }, + "queryable": { + "type": "boolean", + "default": false + }, + "data_type": { + "$ref": "#/definitions/types/nullable_data_type", + "default": null + }, + "unit": { + "$ref": "#/definitions/types/nullable_string", + "default": null + }, + "format": { + "$ref": "#/definitions/types/nullable_format", + "default": null + }, + "invalid": { + "$ref": "#/definitions/types/nullable_invalid", + "default": null + }, + "number_of_decimals": { + "$ref": "#/definitions/types/nullable_number", + "default": null + }, + "channel": { + "type": "string", + "description": "Channel unique uuid v4 identifier used across services" + }, + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "type" : { - "const" : "dynamic" + "if": { + "properties": { + "type": { + "const": "dynamic" } } }, - "then" : { + "then": { "properties": { - "actual_value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "actual_value": { + "$ref": "#/definitions/types/string_number_boolean_null" }, - "previous_value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "previous_value": { + "$ref": "#/definitions/types/string_number_boolean_null" }, - "expected_value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "expected_value": { + "$ref": "#/definitions/types/string_number_boolean_null" }, - "pending" : { - "type" : "boolean" + "pending": { + "type": "boolean" } }, - "required" : [ + "required": [ "id", "type", "identifier", @@ -229,13 +229,13 @@ "channel" ] }, - "else" : { + "else": { "properties": { - "value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "value": { + "$ref": "#/definitions/types/string_number_boolean_null" } }, - "required" : [ + "required": [ "id", "type", "identifier", diff --git a/resources/schemas/devices-module/entity.connector.control.json b/resources/schemas/devices-module/entity.connector.control.json index 47f8930..1134997 100644 --- a/resources/schemas/devices-module/entity.connector.control.json +++ b/resources/schemas/devices-module/entity.connector.control.json @@ -1,22 +1,41 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + } + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" + }, + "name": { + "type": "string" }, - "name" : { - "type" : "string" + "connector": { + "type": "string", + "description": "Connector unique uuid v4 identifier used across services" }, - "connector" : { - "type" : "string", - "description" : "Connector unique uuid v4 identifier used across services" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "required" : [ + "required": [ "id", "name", - "connector" + "connector", + "owner" ] } diff --git a/resources/schemas/devices-module/entity.connector.json b/resources/schemas/devices-module/entity.connector.json index fe30f2d..fd4ec54 100644 --- a/resources/schemas/devices-module/entity.connector.json +++ b/resources/schemas/devices-module/entity.connector.json @@ -1,31 +1,31 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] }, - "nullable_number" : { - "oneOf" : [ + "nullable_number": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "number" + "type": "number" } ] } }, - "type" : { - "type" : "string", - "enum" : [ + "type": { + "type": "string", + "enum": [ "fb-bus", "fb-mqtt", "shelly", @@ -35,50 +35,54 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "type" : { - "$ref" : "#/definitions/type" + "type": { + "$ref": "#/definitions/type" }, - "key" : { - "type" : "string", - "description" : "Unique pub/sub identifier per each entity" + "key": { + "type": "string", + "description": "Unique pub/sub identifier per each entity" }, - "name" : { - "type" : "string" + "name": { + "type": "string" }, - "enabled" : { - "type" : "boolean", - "default" : false + "enabled": { + "type": "boolean", + "default": false + }, + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "type" : { - "const" : "fb-bus" + "if": { + "properties": { + "type": { + "const": "fb-bus" } } }, - "then" : { - "properties" : { - "address" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "then": { + "properties": { + "address": { + "$ref": "#/definitions/types/nullable_number", + "default": null }, - "serial_interface" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "serial_interface": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "baud_rate" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "baud_rate": { + "$ref": "#/definitions/types/nullable_number", + "default": null } }, - "required" : [ + "required": [ "id", "type", "key", @@ -86,37 +90,38 @@ "enabled", "address", "serial_interface", - "baud_rate" + "baud_rate", + "owner" ] }, - "else" : { - "if" : { - "properties" : { - "type" : { - "const" : "fb-mqtt" + "else": { + "if": { + "properties": { + "type": { + "const": "fb-mqtt" } } }, - "then" : { - "properties" : { - "server" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "then": { + "properties": { + "server": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "port" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "port": { + "$ref": "#/definitions/types/nullable_number", + "default": null }, - "secured_port" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "secured_port": { + "$ref": "#/definitions/types/nullable_number", + "default": null }, - "username" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "username": { + "$ref": "#/definitions/types/nullable_string", + "default": null } }, - "required" : [ + "required": [ "id", "type", "key", @@ -125,16 +130,18 @@ "server", "port", "secured_port", - "username" + "username", + "owner" ] }, - "else" : { - "required" : [ + "else": { + "required": [ "id", "type", "key", "name", - "enabled" + "enabled", + "owner" ] } } diff --git a/resources/schemas/devices-module/entity.device.configuration.json b/resources/schemas/devices-module/entity.device.configuration.json index 5636b45..0ad4121 100644 --- a/resources/schemas/devices-module/entity.device.configuration.json +++ b/resources/schemas/devices-module/entity.device.configuration.json @@ -1,44 +1,44 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] }, - "nullable_number" : { - "oneOf" : [ + "nullable_number": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "number" + "type": "number" } ] }, - "nullable_string_number" : { - "oneOf" : [ + "nullable_string_number": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" } ] } }, - "data_type" : { - "type" : "string", - "enum" : [ + "data_type": { + "type": "string", + "enum": [ "char", "uchar", "short", @@ -52,63 +52,63 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "identifier" : { - "type" : "string", - "description" : "Unique human readable identifier used across services" + "identifier": { + "type": "string", + "description": "Unique human readable identifier used across services" }, - "key" : { - "type" : "string", - "description" : "Unique pub/sub identifier per each entity" + "key": { + "type": "string", + "description": "Unique pub/sub identifier per each entity" }, - "name" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "name": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "comment" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "comment": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "data_type" : { - "$ref" : "#/definitions/data_type", - "default" : null + "data_type": { + "$ref": "#/definitions/data_type", + "default": null }, - "default" : { - "$ref" : "#/definitions/types/nullable_string_number", - "default" : null + "default": { + "$ref": "#/definitions/types/nullable_string_number", + "default": null }, - "value" : { - "$ref" : "#/definitions/types/nullable_string_number", - "default" : null + "value": { + "$ref": "#/definitions/types/nullable_string_number", + "default": null }, - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "data_type" : { - "const" : "enum" + "if": { + "properties": { + "data_type": { + "const": "enum" } } }, - "then" : { - "properties" : { - "values" : { - "type" : "array" + "then": { + "properties": { + "values": { + "type": "array" } }, - "required" : [ + "required": [ "id", "identifier", "key", @@ -121,11 +121,11 @@ "values" ] }, - "else" : { - "if" : { - "properties" : { - "data_type" : { - "enum" : [ + "else": { + "if": { + "properties": { + "data_type": { + "enum": [ "char", "uchar", "short", @@ -137,22 +137,22 @@ } } }, - "then" : { - "properties" : { - "min" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "then": { + "properties": { + "min": { + "$ref": "#/definitions/types/nullable_number", + "default": null }, - "max" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "max": { + "$ref": "#/definitions/types/nullable_number", + "default": null }, - "step" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null + "step": { + "$ref": "#/definitions/types/nullable_number", + "default": null } }, - "required" : [ + "required": [ "id", "identifier", "key", @@ -167,8 +167,8 @@ "step" ] }, - "else" : { - "required" : [ + "else": { + "required": [ "id", "identifier", "key", diff --git a/resources/schemas/devices-module/entity.device.control.json b/resources/schemas/devices-module/entity.device.control.json index ab8512c..781defd 100644 --- a/resources/schemas/devices-module/entity.device.control.json +++ b/resources/schemas/devices-module/entity.device.control.json @@ -1,24 +1,38 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + } + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "name" : { - "type" : "string" + "name": { + "type": "string" }, - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "required" : [ + "required": [ "id", "name", "device" diff --git a/resources/schemas/devices-module/entity.device.json b/resources/schemas/devices-module/entity.device.json index eb18bdf..25303a5 100644 --- a/resources/schemas/devices-module/entity.device.json +++ b/resources/schemas/devices-module/entity.device.json @@ -1,21 +1,21 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] } }, - "type" : { - "type" : "string", - "enum" : [ + "type": { + "type": "string", + "enum": [ "network", "local", "virtual", @@ -23,78 +23,78 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "type" : { - "$ref" : "#/definitions/type" + "type": { + "$ref": "#/definitions/type" }, - "identifier" : { - "type" : "string", - "description" : "Unique human readable identifier used across services" + "identifier": { + "type": "string", + "description": "Unique human readable identifier used across services" }, - "key" : { - "type" : "string", - "description" : "Unique pub/sub identifier per each entity" + "key": { + "type": "string", + "description": "Unique pub/sub identifier per each entity" }, - "name" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "name": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "comment" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "comment": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "enabled" : { - "type" : "boolean", - "default" : false + "enabled": { + "type": "boolean", + "default": false }, - "hardware_version" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "hardware_manufacturer": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "hardware_manufacturer" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "hardware_model": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "hardware_model" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "hardware_version": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "hardware_mac_address" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "hardware_mac_address": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "firmware_manufacturer" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "firmware_manufacturer": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "firmware_version" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "firmware_version": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "connector" : { - "type" : "string", - "description" : "Entity connector uuid v4 identifier" + "connector": { + "type": "string", + "description": "Entity connector uuid v4 identifier" }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "required" : [ + "required": [ "id", "identifier", "key", "name", "comment", "enabled", - "hardware_version", "hardware_manufacturer", "hardware_model", + "hardware_version", "hardware_mac_address", "firmware_manufacturer", "firmware_version", diff --git a/resources/schemas/devices-module/entity.device.property.json b/resources/schemas/devices-module/entity.device.property.json index 44592a2..cb57f16 100644 --- a/resources/schemas/devices-module/entity.device.property.json +++ b/resources/schemas/devices-module/entity.device.property.json @@ -1,67 +1,67 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] }, - "nullable_number" : { - "oneOf" : [ + "nullable_number": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "number" + "type": "number" } ] }, - "string_number" : { - "oneOf" : [ + "string_number": { + "oneOf": [ { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" } ] }, - "nullable_data_type" : { - "oneOf" : [ + "nullable_data_type": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "$ref" : "#/definitions/datatype" + "$ref": "#/definitions/datatype" } ] }, - "nullable_format" : { - "oneOf" : [ + "nullable_format": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { "type": "array", "uniqueItems": true, "items": { - "type" : "string" + "type": "string" } }, { "type": "array", "uniqueItems": true, "items": { - "type" : "array", + "type": "array", "uniqueItems": true, "items": { - "$ref" : "#/definitions/types/nullable_string" + "$ref": "#/definitions/types/nullable_string" }, "minItems": 3, "maxItems": 3 @@ -71,53 +71,53 @@ "type": "array", "uniqueItems": true, "items": { - "$ref" : "#/definitions/types/nullable_number" + "$ref": "#/definitions/types/nullable_number" }, "minItems": 2, "maxItems": 2 } ] }, - "nullable_invalid" : { - "oneOf" : [ + "nullable_invalid": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" } ] }, - "string_number_boolean_null" : { - "oneOf" : [ + "string_number_boolean_null": { + "oneOf": [ { - "type" : "string" + "type": "string" }, { - "type" : "number" + "type": "number" }, { - "type" : "boolean" + "type": "boolean" }, { - "type" : "null" + "type": "null" } ] } }, - "type" : { - "type" : "string", - "enum" : [ + "type": { + "type": "string", + "enum": [ "static", "dynamic" ] }, - "datatype" : { - "type" : "string", - "enum" : [ + "datatype": { + "type": "string", + "enum": [ "char", "uchar", "short", @@ -134,87 +134,87 @@ ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" - }, - "type" : { - "$ref" : "#/definitions/type" - }, - "identifier" : { - "type" : "string", - "description" : "Unique human readable identifier used across services" - }, - "key" : { - "type" : "string", - "description" : "Unique pub/sub identifier per each entity" - }, - "name" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null - }, - "settable" : { - "type" : "boolean", - "default" : false - }, - "queryable" : { - "type" : "boolean", - "default" : false - }, - "data_type" : { - "$ref" : "#/definitions/types/nullable_data_type", - "default" : null - }, - "unit" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null - }, - "format" : { - "$ref" : "#/definitions/types/nullable_format", - "default" : null - }, - "invalid" : { - "$ref" : "#/definitions/types/nullable_invalid", - "default" : null - }, - "number_of_decimals" : { - "$ref" : "#/definitions/types/nullable_number", - "default" : null - }, - "device" : { - "type" : "string", - "description" : "Device unique uuid v4 identifier used across services" - }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" + }, + "type": { + "$ref": "#/definitions/type" + }, + "identifier": { + "type": "string", + "description": "Unique human readable identifier used across services" + }, + "key": { + "type": "string", + "description": "Unique pub/sub identifier per each entity" + }, + "name": { + "$ref": "#/definitions/types/nullable_string", + "default": null + }, + "settable": { + "type": "boolean", + "default": false + }, + "queryable": { + "type": "boolean", + "default": false + }, + "data_type": { + "$ref": "#/definitions/types/nullable_data_type", + "default": null + }, + "unit": { + "$ref": "#/definitions/types/nullable_string", + "default": null + }, + "format": { + "$ref": "#/definitions/types/nullable_format", + "default": null + }, + "invalid": { + "$ref": "#/definitions/types/nullable_invalid", + "default": null + }, + "number_of_decimals": { + "$ref": "#/definitions/types/nullable_number", + "default": null + }, + "device": { + "type": "string", + "description": "Device unique uuid v4 identifier used across services" + }, + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Entity owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "type" : { - "const" : "dynamic" + "if": { + "properties": { + "type": { + "const": "dynamic" } } }, - "then" : { + "then": { "properties": { - "actual_value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "actual_value": { + "$ref": "#/definitions/types/string_number_boolean_null" }, - "previous_value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "previous_value": { + "$ref": "#/definitions/types/string_number_boolean_null" }, - "expected_value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "expected_value": { + "$ref": "#/definitions/types/string_number_boolean_null" }, - "pending" : { - "type" : "boolean" + "pending": { + "type": "boolean" } }, - "required" : [ + "required": [ "id", "type", "identifier", @@ -229,13 +229,13 @@ "device" ] }, - "else" : { + "else": { "properties": { - "value" : { - "$ref" : "#/definitions/types/string_number_boolean_null" + "value": { + "$ref": "#/definitions/types/string_number_boolean_null" } }, - "required" : [ + "required": [ "id", "type", "identifier", diff --git a/resources/schemas/modules.json b/resources/schemas/modules.json index 28e5a37..7c640d5 100644 --- a/resources/schemas/modules.json +++ b/resources/schemas/modules.json @@ -1,9 +1,9 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "method" : { - "type" : "string", - "enum" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "method": { + "type": "string", + "enum": [ "get", "post", "patch", @@ -11,50 +11,50 @@ ] } }, - "type" : "object", - "additionalProperties" : { - "type" : "array", - "uniqueItems" : true, - "items" : { - "type" : "object", - "properties" : { - "version" : { - "type" : "string", - "description" : "Module version definition" + "type": "object", + "additionalProperties": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Module version definition" }, - "metadata" : { - "type" : "object", - "properties" : { + "metadata": { + "type": "object", + "properties": { "exchange": { - "type" : "array", - "description" : "Module exchange routing keys", - "uniqueItems" : true, - "items" : { - "type" : "string" + "type": "array", + "description": "Module exchange routing keys", + "uniqueItems": true, + "items": { + "type": "string" } }, - "routes" : { - "type" : "array", - "description" : "Module api routes", - "uniqueItems" : true, - "items" : { - "type" : "object", - "properties" : { - "name" : { - "type" : "string" + "routes": { + "type": "array", + "description": "Module api routes", + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "path" : { - "type" : "string" + "path": { + "type": "string" }, - "method" : { - "$ref" : "#/definitions/method" + "method": { + "$ref": "#/definitions/method" }, "headers": { - "type" : "array", - "description" : "API call required headers", - "uniqueItems" : true, - "items" : { - "type" : "string" + "type": "array", + "description": "API call required headers", + "uniqueItems": true, + "items": { + "type": "string" } } } @@ -63,7 +63,7 @@ } } }, - "required" : [ + "required": [ "version", "metadata" ] diff --git a/resources/schemas/triggers-module/entity.action.json b/resources/schemas/triggers-module/entity.action.json index 5969aef..23de4dd 100644 --- a/resources/schemas/triggers-module/entity.action.json +++ b/resources/schemas/triggers-module/entity.action.json @@ -1,7 +1,17 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + }, "nullable_boolean": { "oneOf": [ { @@ -13,64 +23,64 @@ ] } }, - "type" : { - "type" : "string", - "enum" : [ + "type": { + "type": "string", + "enum": [ "device-property", "channel-property" ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "type" : { - "$ref" : "#/definitions/type" + "type": { + "$ref": "#/definitions/type" }, - "enabled" : { - "type" : "boolean", - "default" : false + "enabled": { + "type": "boolean", + "default": false }, - "is_triggered" : { - "$ref" : "#/definitions/types/nullable_boolean", - "default" : null + "is_triggered": { + "$ref": "#/definitions/types/nullable_boolean", + "default": null }, - "trigger" : { - "type" : "string", - "description" : "Trigger unique uuid v4 identifier used across services" + "trigger": { + "type": "string", + "description": "Trigger unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Device owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Action trigger owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "type" : { - "const" : "channel-property" + "if": { + "properties": { + "type": { + "const": "channel-property" } } }, - "then" : { - "properties" : { - "device" : { - "type" : "string" + "then": { + "properties": { + "device": { + "type": "string" }, - "channel" : { - "type" : "string" + "channel": { + "type": "string" }, - "property" : { - "type" : "string" + "property": { + "type": "string" }, - "value" : { - "type" : "string", - "description" : "Value to be sent to the device" + "value": { + "type": "string", + "description": "Value to be sent to the device" } }, - "required" : [ + "required": [ "id", "type", "enabled", @@ -81,8 +91,8 @@ "value" ] }, - "else" : { - "required" : [ + "else": { + "required": [ "id", "type", "enabled", diff --git a/resources/schemas/triggers-module/entity.condition.json b/resources/schemas/triggers-module/entity.condition.json index 6fad42d..8f064b8 100644 --- a/resources/schemas/triggers-module/entity.condition.json +++ b/resources/schemas/triggers-module/entity.condition.json @@ -1,7 +1,17 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + }, "nullable_boolean": { "oneOf": [ { @@ -13,76 +23,76 @@ ] } }, - "type" : { - "type" : "string", - "enum" : [ + "type": { + "type": "string", + "enum": [ "channel-property", "device-property", "time", "date" ] }, - "operator" : { - "type" : "string", - "enum" : [ + "operator": { + "type": "string", + "enum": [ "eq", "above", "below" ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "type" : { - "$ref" : "#/definitions/type" + "type": { + "$ref": "#/definitions/type" }, - "enabled" : { - "type" : "boolean", - "default" : false + "enabled": { + "type": "boolean", + "default": false }, - "is_fulfilled" : { - "$ref" : "#/definitions/types/nullable_boolean", - "default" : null + "is_fulfilled": { + "$ref": "#/definitions/types/nullable_boolean", + "default": null }, - "trigger" : { - "type" : "string", - "description" : "Trigger unique uuid v4 identifier used across services" + "trigger": { + "type": "string", + "description": "Trigger unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Device owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Condition trigger owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "type" : { - "const" : "channel-property" + "if": { + "properties": { + "type": { + "const": "channel-property" } } }, - "then" : { - "properties" : { - "device" : { - "type" : "string" + "then": { + "properties": { + "device": { + "type": "string" }, - "channel" : { - "type" : "string" + "channel": { + "type": "string" }, - "property" : { - "type" : "string" + "property": { + "type": "string" }, - "operand" : { - "type" : "string" + "operand": { + "type": "string" }, - "operator" : { - "$ref" : "#/definitions/operator" + "operator": { + "$ref": "#/definitions/operator" } }, - "required" : [ + "required": [ "id", "type", "enabled", @@ -94,30 +104,30 @@ "operator" ] }, - "else" : { - "if" : { - "properties" : { - "type" : { - "const" : "device-property" + "else": { + "if": { + "properties": { + "type": { + "const": "device-property" } } }, - "then" : { - "properties" : { - "device" : { - "type" : "string" + "then": { + "properties": { + "device": { + "type": "string" }, - "property" : { - "type" : "string" + "property": { + "type": "string" }, - "operand" : { - "type" : "string" + "operand": { + "type": "string" }, - "operator" : { - "$ref" : "#/definitions/operator" + "operator": { + "$ref": "#/definitions/operator" } }, - "required" : [ + "required": [ "id", "type", "enabled", @@ -128,31 +138,31 @@ "operator" ] }, - "else" : { - "if" : { - "properties" : { - "type" : { - "const" : "time" + "else": { + "if": { + "properties": { + "type": { + "const": "time" } } }, - "then" : { - "properties" : { - "time" : { - "type" : "string", - "description" : "Ful time representation formatted in ATOM" + "then": { + "properties": { + "time": { + "type": "string", + "description": "Ful time representation formatted in ATOM" }, - "days" : { - "type" : "array", - "items" : { - "type" : "number", - "uniqueItems" : true, - "minItems" : 1 + "days": { + "type": "array", + "items": { + "type": "number", + "uniqueItems": true, + "minItems": 1 }, - "description" : "Days numbers 1 - 7 where 1 is mon and 7 is sun" + "description": "Days numbers 1 - 7 where 1 is mon and 7 is sun" } }, - "required" : [ + "required": [ "id", "type", "enabled", @@ -161,22 +171,22 @@ "days" ] }, - "else" : { - "if" : { - "properties" : { - "type" : { - "const" : "date" + "else": { + "if": { + "properties": { + "type": { + "const": "date" } } }, - "then" : { - "properties" : { - "date" : { - "type" : "string", - "description" : "Ful date representation formatted in ATOM" + "then": { + "properties": { + "date": { + "type": "string", + "description": "Ful date representation formatted in ATOM" } }, - "required" : [ + "required": [ "id", "type", "enabled", @@ -184,8 +194,8 @@ "date" ] }, - "else" : { - "required" : [ + "else": { + "required": [ "id", "type", "enabled", diff --git a/resources/schemas/triggers-module/entity.notification.json b/resources/schemas/triggers-module/entity.notification.json index ef68855..90fefcb 100644 --- a/resources/schemas/triggers-module/entity.notification.json +++ b/resources/schemas/triggers-module/entity.notification.json @@ -1,51 +1,63 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "type" : { - "type" : "string", - "enum" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ "email", "sms" ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "type" : { - "$ref" : "#/definitions/type" + "type": { + "$ref": "#/definitions/type" }, - "enabled" : { - "type" : "boolean", - "default" : false + "enabled": { + "type": "boolean", + "default": false }, - "trigger" : { - "type" : "string", - "description" : "Trigger unique uuid v4 identifier used across services" + "trigger": { + "type": "string", + "description": "Trigger unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Device owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Notification trigger owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "type" : { - "const" : "email" + "if": { + "properties": { + "type": { + "const": "email" } } }, - "then" : { - "properties" : { - "email" : { - "type" : "string", - "description" : "Valid email address" + "then": { + "properties": { + "email": { + "type": "string", + "description": "Valid email address" } }, - "required" : [ + "required": [ "id", "type", "enabled", @@ -53,22 +65,22 @@ "email" ] }, - "else" : { - "if" : { - "properties" : { - "type" : { - "const" : "sms" + "else": { + "if": { + "properties": { + "type": { + "const": "sms" } } }, - "then" : { - "properties" : { - "phone" : { - "type" : "string", - "description" : "Internation phone number" + "then": { + "properties": { + "phone": { + "type": "string", + "description": "Internation phone number" } }, - "required" : [ + "required": [ "id", "type", "enabled", @@ -76,8 +88,8 @@ "phone" ] }, - "else" : { - "required" : [ + "else": { + "required": [ "id", "type", "enabled", diff --git a/resources/schemas/triggers-module/entity.trigger.control.json b/resources/schemas/triggers-module/entity.trigger.control.json index 8fbee38..297d1d4 100644 --- a/resources/schemas/triggers-module/entity.trigger.control.json +++ b/resources/schemas/triggers-module/entity.trigger.control.json @@ -1,24 +1,38 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + } + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "name" : { - "type" : "string" + "name": { + "type": "string" }, - "trigger" : { - "type" : "string", - "description" : "Trigger unique uuid v4 identifier used across services" + "trigger": { + "type": "string", + "description": "Trigger unique uuid v4 identifier used across services" }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Trigger control owner uuid v4 identifier" } }, - "required" : [ + "required": [ "id", "name", "trigger" diff --git a/resources/schemas/triggers-module/entity.trigger.json b/resources/schemas/triggers-module/entity.trigger.json index fabf0e4..69886e3 100644 --- a/resources/schemas/triggers-module/entity.trigger.json +++ b/resources/schemas/triggers-module/entity.trigger.json @@ -1,14 +1,14 @@ { - "$schema" : "http://json-schema.org/draft-07/schema#", - "definitions" : { - "types" : { - "nullable_string" : { - "oneOf" : [ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "types": { + "nullable_string": { + "oneOf": [ { - "type" : "null" + "type": "null" }, { - "type" : "string" + "type": "string" } ] }, @@ -23,58 +23,58 @@ ] } }, - "type" : { - "type" : "string", - "enum" : [ + "type": { + "type": "string", + "enum": [ "manual", "automatic" ] } }, - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Entity uuid v4 identifier. This identifier is unique" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entity uuid v4 identifier. This identifier is unique" }, - "type" : { - "$ref" : "#/definitions/type" + "type": { + "$ref": "#/definitions/type" }, - "name" : { - "type" : "string" + "name": { + "type": "string" }, - "comment" : { - "$ref" : "#/definitions/types/nullable_string", - "default" : null + "comment": { + "$ref": "#/definitions/types/nullable_string", + "default": null }, - "enabled" : { - "type" : "boolean", - "default" : false + "enabled": { + "type": "boolean", + "default": false }, - "is_triggered" : { - "$ref" : "#/definitions/types/nullable_boolean", - "default" : null + "is_triggered": { + "$ref": "#/definitions/types/nullable_boolean", + "default": null }, - "owner" : { - "type" : "string", - "description" : "Entity owner uuid v4 identifier" + "owner": { + "$ref": "#/definitions/types/nullable_string", + "description": "Trigger owner uuid v4 identifier" } }, - "if" : { - "properties" : { - "type" : { - "const" : "automatic" + "if": { + "properties": { + "type": { + "const": "automatic" } } }, - "then" : { - "properties" : { - "is_fulfilled" : { + "then": { + "properties": { + "is_fulfilled": { "$ref": "#/definitions/types/nullable_boolean", "default": null } }, - "required" : [ + "required": [ "id", "type", "name", @@ -82,8 +82,8 @@ "enabled" ] }, - "else" : { - "required" : [ + "else": { + "required": [ "id", "type", "name", diff --git a/src/Constants.php b/src/Constants.php index fce9440..ce0d808 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -31,246 +31,291 @@ final class Constants public const EXCHANGE_CHANNEL_NAME = 'fb_exchange'; /** - * Modules origins + * App origins */ public const NOT_SPECIFIED_ORIGIN = '*'; + public const MODULE_ACCOUNTS_ORIGIN = 'com.fastybird.accounts-module'; public const MODULE_DEVICES_ORIGIN = 'com.fastybird.devices-module'; public const MODULE_TRIGGERS_ORIGIN = 'com.fastybird.triggers-module'; public const MODULE_UI_ORIGIN = 'com.fastybird.ui-module'; public const MODULE_WEB_UI_ORIGIN = 'com.fastybird.web-ui-module'; + public const PLUGIN_CONNECTOR_FB_BUS = 'com.fastybird.fb-bus-connector-plugin'; + public const PLUGIN_CONNECTOR_FB_MQTT = 'com.fastybird.fb-mqtt-connector-plugin'; + public const PLUGIN_CONNECTOR_SHELLY = 'com.fastybird.shelly-connector-plugin'; + public const PLUGIN_CONNECTOR_TUYA = 'com.fastybird.tuya-connector-plugin'; + public const PLUGIN_CONNECTOR_SONOFF = 'com.fastybird.sonoff-connector-plugin'; + public const PLUGIN_CONNECTOR_MODBUS = 'com.fastybird.modbus-connector-plugin'; + + public const PLUGIN_EXCHANGE_WS = 'com.fastybird.ws-exchange-plugin'; + public const PLUGIN_EXCHANGE_REDISDB = 'com.fastybird.redisdb-exchange-plugin'; + public const PLUGIN_EXCHANGE_RABBITMQ = 'com.fastybird.rabbitmq-exchange-plugin'; + + public const PLUGIN_STORAGE_REDISDB = 'com.fastybird.redisdb-storage-plugin'; + public const PLUGIN_STORAGE_COUCHDB = 'com.fastybird.couchdb-storage-plugin'; + + /** + * Modules prefixes + */ + + public const MODULE_ACCOUNTS_PREFIX = 'accounts-module'; + public const MODULE_DEVICES_PREFIX = 'devices-module'; + public const MODULE_TRIGGERS_PREFIX = 'triggers-module'; + public const MODULE_UI_PREFIX = 'ui-module'; + /** * Message bus routing keys */ + /** + * Global + */ + + public const MESSAGE_BUS_DEVICES_PROPERTIES_DATA_ROUTING_KEY = 'fb.bus.data.device.property'; + public const MESSAGE_BUS_DEVICES_CONFIGURATION_DATA_ROUTING_KEY = 'fb.bus.data.device.configuration'; + public const MESSAGE_BUS_DEVICES_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.device.control'; + public const MESSAGE_BUS_CHANNELS_PROPERTIES_DATA_ROUTING_KEY = 'fb.bus.data.channel.property'; + public const MESSAGE_BUS_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY = 'fb.bus.data.channel.configuration'; + public const MESSAGE_BUS_CHANNELS_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.channel.control'; + public const MESSAGE_BUS_CONNECTORS_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.connector.control'; + public const MESSAGE_BUS_TRIGGERS_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.trigger.control'; + /** * Accounts module */ // Accounts - public const MESSAGE_BUS_ACCOUNTS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.account'; - public const MESSAGE_BUS_ACCOUNTS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.account'; - public const MESSAGE_BUS_ACCOUNTS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.account'; + public const MESSAGE_BUS_ACCOUNTS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.account'; + public const MESSAGE_BUS_ACCOUNTS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.account'; + public const MESSAGE_BUS_ACCOUNTS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.account'; + public const MESSAGE_BUS_ACCOUNTS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.account'; // Emails - public const MESSAGE_BUS_EMAILS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.email'; - public const MESSAGE_BUS_EMAILS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.email'; - public const MESSAGE_BUS_EMAILS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.email'; + public const MESSAGE_BUS_EMAILS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.email'; + public const MESSAGE_BUS_EMAILS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.email'; + public const MESSAGE_BUS_EMAILS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.email'; + public const MESSAGE_BUS_EMAILS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.email'; // Identities - public const MESSAGE_BUS_IDENTITIES_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.identity'; - public const MESSAGE_BUS_IDENTITIES_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.identity'; - public const MESSAGE_BUS_IDENTITIES_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.identity'; + public const MESSAGE_BUS_IDENTITIES_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.identity'; + public const MESSAGE_BUS_IDENTITIES_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.identity'; + public const MESSAGE_BUS_IDENTITIES_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.identity'; + public const MESSAGE_BUS_IDENTITIES_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.identity'; // Roles - public const MESSAGE_BUS_ROLES_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.role'; - public const MESSAGE_BUS_ROLES_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.role'; - public const MESSAGE_BUS_ROLES_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.role'; + public const MESSAGE_BUS_ROLES_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.role'; + public const MESSAGE_BUS_ROLES_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.role'; + public const MESSAGE_BUS_ROLES_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.role'; + public const MESSAGE_BUS_ROLES_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.role'; /** * Devices module */ // Devices - public const MESSAGE_BUS_DEVICES_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device'; - public const MESSAGE_BUS_DEVICES_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device'; - public const MESSAGE_BUS_DEVICES_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device'; + public const MESSAGE_BUS_DEVICES_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.device'; + public const MESSAGE_BUS_DEVICES_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device'; + public const MESSAGE_BUS_DEVICES_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device'; + public const MESSAGE_BUS_DEVICES_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device'; // Devices properties - public const MESSAGE_BUS_DEVICES_PROPERTY_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device.property'; - public const MESSAGE_BUS_DEVICES_PROPERTY_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device.property'; - public const MESSAGE_BUS_DEVICES_PROPERTY_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device.property'; - - public const MESSAGE_BUS_DEVICES_PROPERTIES_DATA_ROUTING_KEY = 'fb.bus.data.device.property'; + public const MESSAGE_BUS_DEVICES_PROPERTY_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.device.property'; + public const MESSAGE_BUS_DEVICES_PROPERTY_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device.property'; + public const MESSAGE_BUS_DEVICES_PROPERTY_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device.property'; + public const MESSAGE_BUS_DEVICES_PROPERTY_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device.property'; // Devices configuration - public const MESSAGE_BUS_DEVICES_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device.configuration'; - public const MESSAGE_BUS_DEVICES_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device.configuration'; - public const MESSAGE_BUS_DEVICES_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device.configuration'; - - public const MESSAGE_BUS_DEVICES_CONFIGURATION_DATA_ROUTING_KEY = 'fb.bus.data.device.configuration'; + public const MESSAGE_BUS_DEVICES_CONFIGURATION_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.device.configuration'; + public const MESSAGE_BUS_DEVICES_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device.configuration'; + public const MESSAGE_BUS_DEVICES_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device.configuration'; + public const MESSAGE_BUS_DEVICES_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device.configuration'; // Devices control - public const MESSAGE_BUS_DEVICES_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device.control'; - public const MESSAGE_BUS_DEVICES_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device.control'; - public const MESSAGE_BUS_DEVICES_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device.control'; - - public const MESSAGE_BUS_DEVICES_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.device.control'; + public const MESSAGE_BUS_DEVICES_CONTROL_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.device.control'; + public const MESSAGE_BUS_DEVICES_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.device.control'; + public const MESSAGE_BUS_DEVICES_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.device.control'; + public const MESSAGE_BUS_DEVICES_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.device.control'; // Channels - public const MESSAGE_BUS_CHANNELS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel'; - public const MESSAGE_BUS_CHANNELS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel'; - public const MESSAGE_BUS_CHANNELS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel'; + public const MESSAGE_BUS_CHANNELS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.channel'; + public const MESSAGE_BUS_CHANNELS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel'; + public const MESSAGE_BUS_CHANNELS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel'; + public const MESSAGE_BUS_CHANNELS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel'; // Channels properties - public const MESSAGE_BUS_CHANNELS_PROPERTY_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel.property'; - public const MESSAGE_BUS_CHANNELS_PROPERTY_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel.property'; - public const MESSAGE_BUS_CHANNELS_PROPERTY_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel.property'; - - public const MESSAGE_BUS_CHANNELS_PROPERTIES_DATA_ROUTING_KEY = 'fb.bus.data.channel.property'; + public const MESSAGE_BUS_CHANNELS_PROPERTY_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.channel.property'; + public const MESSAGE_BUS_CHANNELS_PROPERTY_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel.property'; + public const MESSAGE_BUS_CHANNELS_PROPERTY_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel.property'; + public const MESSAGE_BUS_CHANNELS_PROPERTY_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel.property'; // Channels configuration - public const MESSAGE_BUS_CHANNELS_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel.configuration'; - public const MESSAGE_BUS_CHANNELS_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel.configuration'; - public const MESSAGE_BUS_CHANNELS_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel.configuration'; - - public const MESSAGE_BUS_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY = 'fb.bus.data.channel.configuration'; + public const MESSAGE_BUS_CHANNELS_CONFIGURATION_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.channel.configuration'; + public const MESSAGE_BUS_CHANNELS_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel.configuration'; + public const MESSAGE_BUS_CHANNELS_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel.configuration'; + public const MESSAGE_BUS_CHANNELS_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel.configuration'; // Channels control - public const MESSAGE_BUS_CHANNELS_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel.control'; - public const MESSAGE_BUS_CHANNELS_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel.control'; - public const MESSAGE_BUS_CHANNELS_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel.control'; - - public const MESSAGE_BUS_CHANNELS_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.channel.control'; + public const MESSAGE_BUS_CHANNELS_CONTROL_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.channel.control'; + public const MESSAGE_BUS_CHANNELS_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.channel.control'; + public const MESSAGE_BUS_CHANNELS_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.channel.control'; + public const MESSAGE_BUS_CHANNELS_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.channel.control'; // Connectors configuration - public const MESSAGE_BUS_CONNECTORS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.connector'; - public const MESSAGE_BUS_CONNECTORS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.connector'; - public const MESSAGE_BUS_CONNECTORS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.connector'; + public const MESSAGE_BUS_CONNECTORS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.connector'; + public const MESSAGE_BUS_CONNECTORS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.connector'; + public const MESSAGE_BUS_CONNECTORS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.connector'; + public const MESSAGE_BUS_CONNECTORS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.connector'; // Connectors control - public const MESSAGE_BUS_CONNECTORS_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.connector.control'; - public const MESSAGE_BUS_CONNECTORS_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.connector.control'; - public const MESSAGE_BUS_CONNECTORS_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.connector.control'; - - public const MESSAGE_BUS_CONNECTORS_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.connector.control'; + public const MESSAGE_BUS_CONNECTORS_CONTROL_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.connector.control'; + public const MESSAGE_BUS_CONNECTORS_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.connector.control'; + public const MESSAGE_BUS_CONNECTORS_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.connector.control'; + public const MESSAGE_BUS_CONNECTORS_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.connector.control'; /** * Triggers module */ // Triggers - public const MESSAGE_BUS_TRIGGERS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger'; - public const MESSAGE_BUS_TRIGGERS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger'; - public const MESSAGE_BUS_TRIGGERS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger'; + public const MESSAGE_BUS_TRIGGERS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.trigger'; + public const MESSAGE_BUS_TRIGGERS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger'; + public const MESSAGE_BUS_TRIGGERS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger'; + public const MESSAGE_BUS_TRIGGERS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger'; // Triggers control - public const MESSAGE_BUS_TRIGGERS_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.control'; - public const MESSAGE_BUS_TRIGGERS_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.control'; - public const MESSAGE_BUS_TRIGGERS_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.control'; - - public const MESSAGE_BUS_TRIGGERS_CONTROL_DATA_ROUTING_KEY = 'fb.bus.data.trigger.control'; + public const MESSAGE_BUS_TRIGGERS_CONTROL_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.trigger.control'; + public const MESSAGE_BUS_TRIGGERS_CONTROL_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.control'; + public const MESSAGE_BUS_TRIGGERS_CONTROL_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.control'; + public const MESSAGE_BUS_TRIGGERS_CONTROL_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.control'; // Triggers actions - public const MESSAGE_BUS_TRIGGERS_ACTIONS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.action'; - public const MESSAGE_BUS_TRIGGERS_ACTIONS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.action'; - public const MESSAGE_BUS_TRIGGERS_ACTIONS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.action'; + public const MESSAGE_BUS_TRIGGERS_ACTIONS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.trigger.action'; + public const MESSAGE_BUS_TRIGGERS_ACTIONS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.action'; + public const MESSAGE_BUS_TRIGGERS_ACTIONS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.action'; + public const MESSAGE_BUS_TRIGGERS_ACTIONS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.action'; // Triggers notifications - public const MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.notification'; - public const MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.notification'; - public const MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.notification'; + public const MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.trigger.notification'; + public const MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.notification'; + public const MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.notification'; + public const MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.notification'; // Triggers conditions - public const MESSAGE_BUS_TRIGGERS_CONDITIONS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.condition'; - public const MESSAGE_BUS_TRIGGERS_CONDITIONS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.condition'; - public const MESSAGE_BUS_TRIGGERS_CONDITIONS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.condition'; + public const MESSAGE_BUS_TRIGGERS_CONDITIONS_REPORTED_ENTITY_ROUTING_KEY = 'fb.bus.entity.reported.trigger.condition'; + public const MESSAGE_BUS_TRIGGERS_CONDITIONS_CREATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.created.trigger.condition'; + public const MESSAGE_BUS_TRIGGERS_CONDITIONS_UPDATED_ENTITY_ROUTING_KEY = 'fb.bus.entity.updated.trigger.condition'; + public const MESSAGE_BUS_TRIGGERS_CONDITIONS_DELETED_ENTITY_ROUTING_KEY = 'fb.bus.entity.deleted.trigger.condition'; /* * JSON schemas mapping */ public const JSON_SCHEMAS_MAPPING = [ - self::NOT_SPECIFIED_ORIGIN => [ - self::MESSAGE_BUS_DEVICES_PROPERTIES_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.device.property.json', - self::MESSAGE_BUS_DEVICES_CONFIGURATION_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.device.configuration.json', - self::MESSAGE_BUS_DEVICES_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.device.control.json', - self::MESSAGE_BUS_CHANNELS_PROPERTIES_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.channel.property.json', - self::MESSAGE_BUS_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.channel.configuration.json', - self::MESSAGE_BUS_CHANNELS_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.channel.control.json', - self::MESSAGE_BUS_CONNECTORS_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.connector.control.json', - self::MESSAGE_BUS_TRIGGERS_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.trigger.control.json', - ], - self::MODULE_ACCOUNTS_ORIGIN => [ - self::MESSAGE_BUS_ACCOUNTS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.account.json', - self::MESSAGE_BUS_ACCOUNTS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.account.json', - self::MESSAGE_BUS_ACCOUNTS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.account.json', - - self::MESSAGE_BUS_EMAILS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.email.json', - self::MESSAGE_BUS_EMAILS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.email.json', - self::MESSAGE_BUS_EMAILS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.email.json', - - self::MESSAGE_BUS_IDENTITIES_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.identity.json', - self::MESSAGE_BUS_IDENTITIES_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.identity.json', - self::MESSAGE_BUS_IDENTITIES_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.identity.json', - - self::MESSAGE_BUS_ROLES_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.role.json', - self::MESSAGE_BUS_ROLES_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.role.json', - self::MESSAGE_BUS_ROLES_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.role.json', - ], - self::MODULE_DEVICES_ORIGIN => [ - self::MESSAGE_BUS_DEVICES_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.json', - self::MESSAGE_BUS_DEVICES_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.json', - self::MESSAGE_BUS_DEVICES_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.json', - - self::MESSAGE_BUS_DEVICES_PROPERTY_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.property.json', - self::MESSAGE_BUS_DEVICES_PROPERTY_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.property.json', - self::MESSAGE_BUS_DEVICES_PROPERTY_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.property.json', - - self::MESSAGE_BUS_DEVICES_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.configuration.json', - self::MESSAGE_BUS_DEVICES_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.configuration.json', - self::MESSAGE_BUS_DEVICES_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.configuration.json', - - self::MESSAGE_BUS_DEVICES_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.control.json', - self::MESSAGE_BUS_DEVICES_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.control.json', - self::MESSAGE_BUS_DEVICES_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.control.json', - - self::MESSAGE_BUS_CHANNELS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.json', - self::MESSAGE_BUS_CHANNELS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.json', - self::MESSAGE_BUS_CHANNELS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.json', - - self::MESSAGE_BUS_CHANNELS_PROPERTY_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.property.json', - self::MESSAGE_BUS_CHANNELS_PROPERTY_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.property.json', - self::MESSAGE_BUS_CHANNELS_PROPERTY_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.property.json', - - self::MESSAGE_BUS_CHANNELS_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.configuration.json', - self::MESSAGE_BUS_CHANNELS_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.configuration.json', - self::MESSAGE_BUS_CHANNELS_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.configuration.json', - - self::MESSAGE_BUS_CHANNELS_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.control.json', - self::MESSAGE_BUS_CHANNELS_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.control.json', - self::MESSAGE_BUS_CHANNELS_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.control.json', - - self::MESSAGE_BUS_CONNECTORS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.json', - self::MESSAGE_BUS_CONNECTORS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.json', - self::MESSAGE_BUS_CONNECTORS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.json', - - self::MESSAGE_BUS_CONNECTORS_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.control.json', - self::MESSAGE_BUS_CONNECTORS_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.control.json', - self::MESSAGE_BUS_CONNECTORS_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.control.json', - ], - self::MODULE_TRIGGERS_ORIGIN => [ - self::MESSAGE_BUS_TRIGGERS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.json', - self::MESSAGE_BUS_TRIGGERS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.json', - self::MESSAGE_BUS_TRIGGERS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.json', - - self::MESSAGE_BUS_TRIGGERS_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.control.json', - self::MESSAGE_BUS_TRIGGERS_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.control.json', - self::MESSAGE_BUS_TRIGGERS_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.control.json', - - self::MESSAGE_BUS_TRIGGERS_ACTIONS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.action.json', - self::MESSAGE_BUS_TRIGGERS_ACTIONS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.action.json', - self::MESSAGE_BUS_TRIGGERS_ACTIONS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.action.json', - - self::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.notification.json', - self::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.notification.json', - self::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.notification.json', - - self::MESSAGE_BUS_TRIGGERS_CONDITIONS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.condition.json', - self::MESSAGE_BUS_TRIGGERS_CONDITIONS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.condition.json', - self::MESSAGE_BUS_TRIGGERS_CONDITIONS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.condition.json', - ], + self::MESSAGE_BUS_DEVICES_PROPERTIES_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.device.property.json', + self::MESSAGE_BUS_DEVICES_CONFIGURATION_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.device.configuration.json', + self::MESSAGE_BUS_DEVICES_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.device.control.json', + self::MESSAGE_BUS_CHANNELS_PROPERTIES_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.channel.property.json', + self::MESSAGE_BUS_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.channel.configuration.json', + self::MESSAGE_BUS_CHANNELS_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.channel.control.json', + self::MESSAGE_BUS_CONNECTORS_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.connector.control.json', + self::MESSAGE_BUS_TRIGGERS_CONTROL_DATA_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.trigger.control.json', + + self::MESSAGE_BUS_ACCOUNTS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.account.json', + self::MESSAGE_BUS_ACCOUNTS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.account.json', + self::MESSAGE_BUS_ACCOUNTS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.account.json', + self::MESSAGE_BUS_ACCOUNTS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.account.json', + + self::MESSAGE_BUS_EMAILS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.email.json', + self::MESSAGE_BUS_EMAILS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.email.json', + self::MESSAGE_BUS_EMAILS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.email.json', + self::MESSAGE_BUS_EMAILS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.email.json', + + self::MESSAGE_BUS_IDENTITIES_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.identity.json', + self::MESSAGE_BUS_IDENTITIES_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.identity.json', + self::MESSAGE_BUS_IDENTITIES_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.identity.json', + self::MESSAGE_BUS_IDENTITIES_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.identity.json', + + self::MESSAGE_BUS_ROLES_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.role.json', + self::MESSAGE_BUS_ROLES_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.role.json', + self::MESSAGE_BUS_ROLES_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.role.json', + self::MESSAGE_BUS_ROLES_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'accounts-module' . DIRECTORY_SEPARATOR . 'entity.role.json', + + self::MESSAGE_BUS_DEVICES_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.json', + self::MESSAGE_BUS_DEVICES_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.json', + self::MESSAGE_BUS_DEVICES_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.json', + self::MESSAGE_BUS_DEVICES_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.json', + + self::MESSAGE_BUS_DEVICES_PROPERTY_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.property.json', + self::MESSAGE_BUS_DEVICES_PROPERTY_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.property.json', + self::MESSAGE_BUS_DEVICES_PROPERTY_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.property.json', + self::MESSAGE_BUS_DEVICES_PROPERTY_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.property.json', + + self::MESSAGE_BUS_DEVICES_CONFIGURATION_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.configuration.json', + self::MESSAGE_BUS_DEVICES_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.configuration.json', + self::MESSAGE_BUS_DEVICES_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.configuration.json', + self::MESSAGE_BUS_DEVICES_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.configuration.json', + + self::MESSAGE_BUS_DEVICES_CONTROL_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.control.json', + self::MESSAGE_BUS_DEVICES_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.control.json', + self::MESSAGE_BUS_DEVICES_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.control.json', + self::MESSAGE_BUS_DEVICES_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.device.control.json', + + self::MESSAGE_BUS_CHANNELS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.json', + self::MESSAGE_BUS_CHANNELS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.json', + self::MESSAGE_BUS_CHANNELS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.json', + self::MESSAGE_BUS_CHANNELS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.json', + + self::MESSAGE_BUS_CHANNELS_PROPERTY_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.property.json', + self::MESSAGE_BUS_CHANNELS_PROPERTY_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.property.json', + self::MESSAGE_BUS_CHANNELS_PROPERTY_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.property.json', + self::MESSAGE_BUS_CHANNELS_PROPERTY_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.property.json', + + self::MESSAGE_BUS_CHANNELS_CONFIGURATION_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.configuration.json', + self::MESSAGE_BUS_CHANNELS_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.configuration.json', + self::MESSAGE_BUS_CHANNELS_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.configuration.json', + self::MESSAGE_BUS_CHANNELS_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.configuration.json', + + self::MESSAGE_BUS_CHANNELS_CONTROL_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.control.json', + self::MESSAGE_BUS_CHANNELS_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.control.json', + self::MESSAGE_BUS_CHANNELS_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.control.json', + self::MESSAGE_BUS_CHANNELS_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.channel.control.json', + + self::MESSAGE_BUS_CONNECTORS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.json', + self::MESSAGE_BUS_CONNECTORS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.json', + self::MESSAGE_BUS_CONNECTORS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.json', + self::MESSAGE_BUS_CONNECTORS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.json', + + self::MESSAGE_BUS_CONNECTORS_CONTROL_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.control.json', + self::MESSAGE_BUS_CONNECTORS_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.control.json', + self::MESSAGE_BUS_CONNECTORS_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.control.json', + self::MESSAGE_BUS_CONNECTORS_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'devices-module' . DIRECTORY_SEPARATOR . 'entity.connector.control.json', + + self::MESSAGE_BUS_TRIGGERS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.json', + self::MESSAGE_BUS_TRIGGERS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.json', + self::MESSAGE_BUS_TRIGGERS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.json', + self::MESSAGE_BUS_TRIGGERS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.json', + + self::MESSAGE_BUS_TRIGGERS_CONTROL_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.control.json', + self::MESSAGE_BUS_TRIGGERS_CONTROL_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.control.json', + self::MESSAGE_BUS_TRIGGERS_CONTROL_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.control.json', + self::MESSAGE_BUS_TRIGGERS_CONTROL_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.trigger.control.json', + + self::MESSAGE_BUS_TRIGGERS_ACTIONS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.action.json', + self::MESSAGE_BUS_TRIGGERS_ACTIONS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.action.json', + self::MESSAGE_BUS_TRIGGERS_ACTIONS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.action.json', + self::MESSAGE_BUS_TRIGGERS_ACTIONS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.action.json', + + self::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.notification.json', + self::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.notification.json', + self::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.notification.json', + self::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.notification.json', + + self::MESSAGE_BUS_TRIGGERS_CONDITIONS_REPORTED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.condition.json', + self::MESSAGE_BUS_TRIGGERS_CONDITIONS_CREATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.condition.json', + self::MESSAGE_BUS_TRIGGERS_CONDITIONS_UPDATED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.condition.json', + self::MESSAGE_BUS_TRIGGERS_CONDITIONS_DELETED_ENTITY_ROUTING_KEY => self::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . 'schemas' . DIRECTORY_SEPARATOR . 'triggers-module' . DIRECTORY_SEPARATOR . 'entity.condition.json', ]; - /** - * Modules prefixes - */ - - public const MODULE_ACCOUNTS_PREFIX = 'accounts-module'; - public const MODULE_DEVICES_PREFIX = 'devices-module'; - public const MODULE_TRIGGERS_PREFIX = 'triggers-module'; - public const MODULE_UI_PREFIX = 'ui-module'; - } diff --git a/src/Loaders/ISchemaLoader.php b/src/Loaders/ISchemaLoader.php index f901a93..5333292 100644 --- a/src/Loaders/ISchemaLoader.php +++ b/src/Loaders/ISchemaLoader.php @@ -15,6 +15,8 @@ namespace FastyBird\ModulesMetadata\Loaders; +use FastyBird\ModulesMetadata\Types; + /** * JSON schema loader interface * @@ -27,11 +29,18 @@ interface ISchemaLoader { /** - * @param string $origin - * @param string $routingKey + * @param Types\RoutingKeyType $routingKey + * + * @return string + */ + public function loadByRoutingKey(Types\RoutingKeyType $routingKey): string; + + /** + * @param string $namespace + * @param string $schemaFile * * @return string */ - public function load(string $origin, string $routingKey): string; + public function loadByNamespace(string $namespace, string $schemaFile): string; } diff --git a/src/Loaders/SchemaLoader.php b/src/Loaders/SchemaLoader.php index cb37cf3..fb1c028 100644 --- a/src/Loaders/SchemaLoader.php +++ b/src/Loaders/SchemaLoader.php @@ -17,6 +17,7 @@ use FastyBird\ModulesMetadata; use FastyBird\ModulesMetadata\Exceptions; +use FastyBird\ModulesMetadata\Types; /** * JSON schema loader @@ -35,24 +36,33 @@ final class SchemaLoader implements ISchemaLoader * @throws Exceptions\FileNotFoundException * @throws Exceptions\InvalidArgumentException */ - public function load(string $origin, string $routingKey): string + public function loadByRoutingKey(Types\RoutingKeyType $routingKey): string { - if (isset(ModulesMetadata\Constants::JSON_SCHEMAS_MAPPING[$origin])) { - $mapping = ModulesMetadata\Constants::JSON_SCHEMAS_MAPPING[$origin]; + if (isset(ModulesMetadata\Constants::JSON_SCHEMAS_MAPPING[$routingKey->getValue()])) { + $schema = file_get_contents(ModulesMetadata\Constants::JSON_SCHEMAS_MAPPING[$routingKey->getValue()]); - if (isset($mapping[$routingKey])) { - $schema = file_get_contents($mapping[$routingKey]); - - if ($schema === false) { - throw new Exceptions\FileNotFoundException('Schema could not be loaded'); - } - - return $schema; + if ($schema === false) { + throw new Exceptions\FileNotFoundException('Schema could not be loaded'); } + + return $schema; } - if (isset(ModulesMetadata\Constants::JSON_SCHEMAS_MAPPING[ModulesMetadata\Constants::NOT_SPECIFIED_ORIGIN][$routingKey])) { - $schema = file_get_contents(ModulesMetadata\Constants::JSON_SCHEMAS_MAPPING[ModulesMetadata\Constants::NOT_SPECIFIED_ORIGIN][$routingKey]); + throw new Exceptions\InvalidArgumentException(sprintf('Schema for routing key: %s is not configured', $routingKey->getValue())); + } + + /** + * {@inheritDoc} + * + * @throws Exceptions\FileNotFoundException + * @throws Exceptions\InvalidArgumentException + */ + public function loadByNamespace(string $namespace, string $schemaFile): string + { + $filePath = ModulesMetadata\Constants::RESOURCES_FOLDER . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR . $schemaFile; + + if (file_exists($filePath)) { + $schema = file_get_contents($filePath); if ($schema === false) { throw new Exceptions\FileNotFoundException('Schema could not be loaded'); @@ -61,7 +71,7 @@ public function load(string $origin, string $routingKey): string return $schema; } - throw new Exceptions\InvalidArgumentException(sprintf('Schema for origin: %s and routing key: %s is not configured', $origin, $routingKey)); + throw new Exceptions\InvalidArgumentException(sprintf('Schema for namespace: %s and file: %s is not configured', $namespace, $schemaFile)); } } diff --git a/src/Types/PluginOriginType.php b/src/Types/PluginOriginType.php new file mode 100644 index 0000000..4e319c4 --- /dev/null +++ b/src/Types/PluginOriginType.php @@ -0,0 +1,58 @@ + + * @package FastyBird:ModulesMetadata! + * @subpackage Types + * @since 0.1.0 + * + * @date 08.01.22 + */ + +namespace FastyBird\ModulesMetadata\Types; + +use Consistence; +use FastyBird\ModulesMetadata; + +/** + * Modules origins types + * + * @package FastyBird:ModulesMetadata! + * @subpackage Types + * + * @author Adam Kadlec + */ +class PluginOriginType extends Consistence\Enum\Enum +{ + + /** + * Define types + */ + public const ORIGIN_NOT_SPECIFIED = ModulesMetadata\Constants::NOT_SPECIFIED_ORIGIN; + public const ORIGIN_PLUGIN_CONNECTOR_FB_BUS = ModulesMetadata\Constants::PLUGIN_CONNECTOR_FB_BUS; + public const ORIGIN_PLUGIN_CONNECTOR_FB_MQTT = ModulesMetadata\Constants::PLUGIN_CONNECTOR_FB_MQTT; + public const ORIGIN_PLUGIN_CONNECTOR_SHELLY = ModulesMetadata\Constants::PLUGIN_CONNECTOR_SHELLY; + public const ORIGIN_PLUGIN_CONNECTOR_TUYA = ModulesMetadata\Constants::PLUGIN_CONNECTOR_TUYA; + public const ORIGIN_PLUGIN_CONNECTOR_SONOFF = ModulesMetadata\Constants::PLUGIN_CONNECTOR_SONOFF; + public const ORIGIN_PLUGIN_CONNECTOR_MODBUS = ModulesMetadata\Constants::PLUGIN_CONNECTOR_MODBUS; + + public const ORIGIN_PLUGIN_EXCHANGE_WS = ModulesMetadata\Constants::PLUGIN_EXCHANGE_WS; + public const ORIGIN_PLUGIN_EXCHANGE_REDISDB = ModulesMetadata\Constants::PLUGIN_EXCHANGE_REDISDB; + public const ORIGIN_PLUGIN_EXCHANGE_RABBITMQ = ModulesMetadata\Constants::PLUGIN_EXCHANGE_RABBITMQ; + + public const ORIGIN_PLUGIN_STORAGE_REDISDB = ModulesMetadata\Constants::PLUGIN_STORAGE_REDISDB; + public const ORIGIN_PLUGIN_STORAGE_COUCHDB = ModulesMetadata\Constants::PLUGIN_STORAGE_COUCHDB; + + /** + * @return string + */ + public function __toString(): string + { + return (string) self::getValue(); + } + +} diff --git a/src/Types/RoutingKeyType.php b/src/Types/RoutingKeyType.php index 632017c..ebb4798 100644 --- a/src/Types/RoutingKeyType.php +++ b/src/Types/RoutingKeyType.php @@ -32,68 +32,90 @@ class RoutingKeyType extends Consistence\Enum\Enum /** * Define types */ + public const ROUTE_DEVICES_PROPERTIES_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_PROPERTIES_DATA_ROUTING_KEY; + public const ROUTE_DEVICES_CONFIGURATION_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONFIGURATION_DATA_ROUTING_KEY; + public const ROUTE_DEVICES_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONTROL_DATA_ROUTING_KEY; + public const ROUTE_CHANNELS_PROPERTIES_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_PROPERTIES_DATA_ROUTING_KEY; + public const ROUTE_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY; + public const ROUTE_CHANNELS_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONTROL_DATA_ROUTING_KEY; + public const ROUTE_CONNECTORS_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_CONTROL_DATA_ROUTING_KEY; + public const ROUTE_TRIGGERS_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONTROL_DATA_ROUTING_KEY; + + public const ROUTE_ACCOUNTS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_ACCOUNTS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_ACCOUNTS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_ACCOUNTS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_ACCOUNTS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_ACCOUNTS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_ACCOUNTS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_ACCOUNTS_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_EMAILS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_EMAILS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_EMAILS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_EMAILS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_EMAILS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_EMAILS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_EMAILS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_EMAILS_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_IDENTITIES_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_IDENTITIES_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_IDENTITIES_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_IDENTITIES_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_IDENTITIES_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_IDENTITIES_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_IDENTITIES_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_IDENTITIES_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_ROLES_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_ROLES_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_ROLES_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_ROLES_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_ROLES_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_ROLES_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_ROLES_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_ROLES_DELETED_ENTITY_ROUTING_KEY; + + public const ROUTE_DEVICES_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_DEVICES_PROPERTY_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_PROPERTY_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_PROPERTY_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_PROPERTY_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_PROPERTY_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_PROPERTY_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_PROPERTY_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_PROPERTY_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_DEVICES_PROPERTIES_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_PROPERTIES_DATA_ROUTING_KEY; + public const ROUTE_DEVICES_CONFIGURATION_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONFIGURATION_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_CONFIGURATION_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_CONFIGURATION_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_CONFIGURATION_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_DEVICES_CONFIGURATION_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONFIGURATION_DATA_ROUTING_KEY; + public const ROUTE_DEVICES_CONTROL_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONTROL_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_CONTROL_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONTROL_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_CONTROL_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONTROL_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_DEVICES_CONTROL_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONTROL_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_DEVICES_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CONTROL_DATA_ROUTING_KEY; + public const ROUTE_CHANNELS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_CHANNELS_PROPERTY_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_PROPERTY_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_PROPERTY_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_PROPERTY_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_PROPERTY_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_PROPERTY_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_PROPERTY_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_PROPERTY_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_CHANNELS_PROPERTIES_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_PROPERTIES_DATA_ROUTING_KEY; + public const ROUTE_CHANNELS_CONFIGURATION_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONFIGURATION_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_CONFIGURATION_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONFIGURATION_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_CONFIGURATION_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONFIGURATION_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_CONFIGURATION_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONFIGURATION_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONFIGURATION_DATA_ROUTING_KEY; + public const ROUTE_CHANNELS_CONTROL_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONTROL_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_CONTROL_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONTROL_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_CONTROL_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONTROL_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_CHANNELS_CONTROL_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONTROL_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_CHANNELS_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CHANNELS_CONTROL_DATA_ROUTING_KEY; + public const ROUTE_CONNECTORS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_CONNECTORS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_CONNECTORS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_CONNECTORS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_CONNECTORS_CONTROL_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_CONTROL_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_CONNECTORS_CONTROL_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_CONTROL_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_CONNECTORS_CONTROL_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_CONTROL_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_CONNECTORS_CONTROL_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_CONTROL_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_CONNECTORS_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_CONNECTORS_CONTROL_DATA_ROUTING_KEY; + + public const ROUTE_TRIGGERS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_TRIGGERS_CONTROL_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONTROL_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_CONTROL_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONTROL_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_CONTROL_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONTROL_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_CONTROL_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONTROL_DELETED_ENTITY_ROUTING_KEY; - public const ROUTE_TRIGGERS_CONTROL_ENTITY_DATA_ROUTING_KEY = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONTROL_DATA_ROUTING_KEY; + public const ROUTE_TRIGGERS_ACTIONS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_ACTIONS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_ACTIONS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_ACTIONS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_ACTIONS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_ACTIONS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_ACTIONS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_ACTIONS_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_TRIGGERS_NOTIFICATIONS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_NOTIFICATIONS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_NOTIFICATIONS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_NOTIFICATIONS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_NOTIFICATIONS_DELETED_ENTITY_ROUTING_KEY; + public const ROUTE_TRIGGERS_CONDITIONS_ENTITY_REPORTED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONDITIONS_REPORTED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_CONDITIONS_ENTITY_CREATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONDITIONS_CREATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_CONDITIONS_ENTITY_UPDATED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONDITIONS_UPDATED_ENTITY_ROUTING_KEY; public const ROUTE_TRIGGERS_CONDITIONS_ENTITY_DELETED = ModulesMetadata\Constants::MESSAGE_BUS_TRIGGERS_CONDITIONS_DELETED_ENTITY_ROUTING_KEY; diff --git a/tests/cases/Unit/Loaders/SchemaLoaderTest.phpt b/tests/cases/Unit/Loaders/SchemaLoaderTest.phpt index 67ee629..522476e 100644 --- a/tests/cases/Unit/Loaders/SchemaLoaderTest.phpt +++ b/tests/cases/Unit/Loaders/SchemaLoaderTest.phpt @@ -19,21 +19,11 @@ final class SchemaLoaderTest extends BaseTestCase { $loader = new Loaders\SchemaLoader(); - $result = $loader->load(ModulesMetadata\Constants::MODULE_DEVICES_ORIGIN, ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CREATED_ENTITY_ROUTING_KEY); + $result = $loader->loadByRoutingKey(ModulesMetadata\Types\RoutingKeyType::get(ModulesMetadata\Types\RoutingKeyType::ROUTE_DEVICES_ENTITY_CREATED)); Assert::true($result !== null); } - /** - * @throws FastyBird\ModulesMetadata\Exceptions\InvalidArgumentException - */ - public function testValidateDevicePropertyInvalid(): void - { - $loader = new Loaders\SchemaLoader(); - - $loader->load(ModulesMetadata\Constants::MODULE_TRIGGERS_ORIGIN, ModulesMetadata\Constants::MESSAGE_BUS_DEVICES_CREATED_ENTITY_ROUTING_KEY); - } - } $test_case = new SchemaLoaderTest(); diff --git a/tests/pytests/tests.py b/tests/pytests/tests.py index 6b53fb9..a85f072 100644 --- a/tests/pytests/tests.py +++ b/tests/pytests/tests.py @@ -16,15 +16,13 @@ import unittest # Library libs -from modules_metadata.loader import load_schema +from modules_metadata.loader import load_schema_by_routing_key from modules_metadata.routing import RoutingKey -from modules_metadata.types import ModuleOrigin class TestLoader(unittest.TestCase): def test_load_data_schema(self): - loaded_schema = load_schema( - ModuleOrigin(ModuleOrigin.NOT_SPECIFIED), + loaded_schema = load_schema_by_routing_key( RoutingKey(RoutingKey.CHANNELS_PROPERTIES_DATA), )