diff --git a/inventory/python/CHANGELOG.md b/inventory/python/CHANGELOG.md index e95b900..7ab7fa3 100644 --- a/inventory/python/CHANGELOG.md +++ b/inventory/python/CHANGELOG.md @@ -20,4 +20,9 @@ # 1.2.1 - Updated inventory AddDevice and UpdateDevice settings, so they can also contain empty values. - Useful when adding devices that have failed during the workflow. \ No newline at end of file + Useful when adding devices that have failed during the workflow. + +# 1.3.0 +- Bumped version of frinx-inventory-api to 2.1.0. +- Implemented new inventory workers for following mutations and query: + AddStreamMutation, UpdateStreamMutation, DeleteStreamMutation, StreamsQuery. diff --git a/inventory/python/frinx_worker/inventory/__init__.py b/inventory/python/frinx_worker/inventory/__init__.py index 16ddcc7..c208aed 100644 --- a/inventory/python/frinx_worker/inventory/__init__.py +++ b/inventory/python/frinx_worker/inventory/__init__.py @@ -18,11 +18,17 @@ from frinx_api.inventory import AddDeviceInput from frinx_api.inventory import AddDeviceMutation from frinx_api.inventory import AddDevicePayload +from frinx_api.inventory import AddStreamInput +from frinx_api.inventory import AddStreamMutation +from frinx_api.inventory import AddStreamPayload +from frinx_api.inventory import Blueprint from frinx_api.inventory import CreateLabelInput from frinx_api.inventory import CreateLabelMutation from frinx_api.inventory import CreateLabelPayload from frinx_api.inventory import DeleteDeviceMutation from frinx_api.inventory import DeleteDevicePayload +from frinx_api.inventory import DeleteStreamMutation +from frinx_api.inventory import DeleteStreamPayload from frinx_api.inventory import Device from frinx_api.inventory import DeviceConnection from frinx_api.inventory import DeviceEdge @@ -30,6 +36,7 @@ from frinx_api.inventory import DeviceSize from frinx_api.inventory import DevicesQuery from frinx_api.inventory import FilterDevicesInput +from frinx_api.inventory import FilterStreamsInput from frinx_api.inventory import InstallDeviceMutation from frinx_api.inventory import InstallDevicePayload from frinx_api.inventory import Label @@ -37,16 +44,24 @@ from frinx_api.inventory import LabelEdge from frinx_api.inventory import LabelsQuery from frinx_api.inventory import PageInfo +from frinx_api.inventory import Stream +from frinx_api.inventory import StreamConnection +from frinx_api.inventory import StreamEdge +from frinx_api.inventory import StreamsQuery from frinx_api.inventory import UninstallDeviceMutation from frinx_api.inventory import UninstallDevicePayload from frinx_api.inventory import UpdateDeviceInput from frinx_api.inventory import UpdateDeviceMutation from frinx_api.inventory import UpdateDevicePayload +from frinx_api.inventory import UpdateStreamInput +from frinx_api.inventory import UpdateStreamMutation +from frinx_api.inventory import UpdateStreamPayload from frinx_api.inventory import Zone from frinx_api.inventory import ZoneEdge from frinx_api.inventory import ZonesConnection from frinx_api.inventory import ZonesQuery from graphql_pydantic_converter.graphql_types import QueryForm +from pydantic import Field from .utils import CursorGroup from .utils import CursorGroups @@ -76,6 +91,39 @@ class DeviceInput(TaskInput): device_type: str | None = None +class StreamWorkerInput(TaskInput): + stream_name: str = Field( + description="Name of the stream.", + ) + device_name: str = Field( + description="Name of the device to which the stream is added.", + ) + blueprint_id: str | None = Field( + description="Blueprint identifier.", + default=None + ) + stream_parameters: DictAny | None = Field( + description="Stream parameters.", + default=None + ) + + +class InventoryWorkerOutput(TaskOutput): + query: str = Field( + description="Constructed GraphQL query.", + ) + variable: DictAny | None = Field( + description="Constructed input GraphQL variables.", + default=None + ) + response_body: Any = Field( + description="Response body.", + ) + response_code: int = Field( + description="Response code.", + ) + + class InventoryService(ServiceWorkersImpl): class InventoryGetDevicesInfo(WorkerImpl): DEVICES: DeviceConnection = DeviceConnection( @@ -117,10 +165,8 @@ class WorkerInput(TaskInput): cursor: str | None = None type: PaginationCursorType | None = None - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response: DictAny + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: devices = DevicesQuery( @@ -164,11 +210,8 @@ class WorkerDefinition(TaskDefinition): class WorkerInput(TaskInput): device_id: str - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_code: int - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: self.install_device.id = worker_input.device_id @@ -194,11 +237,8 @@ class WorkerDefinition(TaskDefinition): class WorkerInput(TaskInput): device_id: str - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_code: int - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: self.uninstall_device.id = worker_input.device_id @@ -244,11 +284,8 @@ class WorkerDefinition(TaskDefinition): class WorkerInput(TaskInput): device_name: str - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_code: int - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... @classmethod def _get_device_id(cls, device_name: str) -> str: @@ -313,10 +350,8 @@ class WorkerDefinition(TaskDefinition): class WorkerInput(TaskInput): device_name: str - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... def _get_device_id(self, device_name: str) -> str: query = DevicesQuery(payload=self.DEVICES, filter=FilterDevicesInput(deviceName=device_name)).render() @@ -376,11 +411,8 @@ class WorkerInput(TaskInput): cursor: str | None = None type: PaginationCursorType | None = None - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_code: int - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: labels = LabelsQuery( @@ -472,10 +504,8 @@ class WorkerDefinition(TaskDefinition): class WorkerInput(TaskInput): label: str - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: self.create_label.input.name = worker_input.label @@ -510,10 +540,8 @@ class WorkerInput(DeviceInput): device_name: str zone_id: str - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: self.add_device.input.name = worker_input.device_name @@ -833,23 +861,8 @@ class WorkerInput(TaskInput): Identifier of the removed device. """ - class WorkerOutput(TaskOutput): - query: str - """ - Request GraphQL query. - """ - variable: DictAny | None = None - """ - Request GraphQL variables. - """ - response_body: Any - """ - Response containing the name and identifier of the removed device. - """ - response_code: int - """ - Status of the operation. - """ + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: self.delete_device.id = worker_input.device_id @@ -884,11 +897,8 @@ class WorkerInput(DeviceInput): device_id: str location_id: str | None = None - class WorkerOutput(TaskOutput): - query: str - variable: DictAny | None = None - response_code: int - response_body: Any + class WorkerOutput(InventoryWorkerOutput): + ... def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: self.update_device.id = worker_input.device_id @@ -900,6 +910,182 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: response = execute_inventory_query(query=query.query, variables=query.variable) return response_handler(query, response) + class InventoryAddStream(WorkerImpl): + ADD_STREAM: AddStreamPayload = AddStreamPayload(stream=Stream(id=True, createdAt=True)) + + add_stream: AddStreamMutation = AddStreamMutation( + payload=ADD_STREAM, + input=AddStreamInput( + streamName="streamName", + deviceName="deviceName", + streamParameters="{}" + ), + ) + + class ExecutionProperties(TaskExecutionProperties): + exclude_empty_inputs: bool = False + transform_string_to_json_valid: bool = True + + class WorkerDefinition(TaskDefinition): + name: str = "INVENTORY_add_stream" + description: str = "Add stream to inventory database" + labels: ListStr = ["BASICS", "MAIN", "INVENTORY", "STREAMS"] + timeout_seconds: int = 60 + response_timeout_seconds: int = 60 + + class WorkerInput(StreamWorkerInput): + ... + + class WorkerOutput(InventoryWorkerOutput): + ... + + def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: + self.add_stream.input.deviceName = worker_input.device_name + self.add_stream.input.streamName = worker_input.stream_name + if worker_input.stream_parameters: + self.add_stream.input.streamParameters = json.dumps(worker_input.stream_parameters) + if worker_input.blueprint_id: + self.add_stream.input.blueprintId = worker_input.blueprint_id + + query = self.add_stream.render() + response = execute_inventory_query(query=query.query, variables=query.variable) + return response_handler(query, response) + + class InventoryUpdateStream(WorkerImpl): + UPDATE_STREAM = UpdateStreamPayload(stream=Stream(streamName=True, deviceName=True, updatedAt=True)) + + update_stream = UpdateStreamMutation( + id="streamId", + payload=UPDATE_STREAM, + input=UpdateStreamInput( + streamName="streamName", + deviceName="deviceName" + ) + ) + + class ExecutionProperties(TaskExecutionProperties): + exclude_empty_inputs: bool = True + transform_string_to_json_valid: bool = True + + class WorkerDefinition(TaskDefinition): + name: str = "INVENTORY_update_stream" + description: str = "Update stream in inventory database" + labels: ListStr = ["BASICS", "MAIN", "INVENTORY", "STREAMS"] + timeout_seconds: int = 60 + response_timeout_seconds: int = 60 + + class WorkerInput(StreamWorkerInput): + stream_id: str = Field( + description="Identifier of the stream.", + ) + + class WorkerOutput(InventoryWorkerOutput): + ... + + def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: + self.update_stream.id = worker_input.stream_id + self.update_stream.input.streamName = worker_input.stream_name + self.update_stream.input.deviceName = worker_input.device_name + if worker_input.blueprint_id: + self.update_stream.input.blueprintId = worker_input.blueprint_id + if worker_input.stream_parameters: + self.update_stream.input.streamParameters = json.dumps(worker_input.stream_parameters) + + query = self.update_stream.render() + response = execute_inventory_query(query=query.query, variables=query.variable) + return response_handler(query, response) + + class InventoryDeleteStream(WorkerImpl): + DELETE_STREAM = DeleteStreamPayload(stream=Stream(streamName=True, deviceName=True)) + + delete_stream = DeleteStreamMutation( + payload=DELETE_STREAM, + id="streamId" + ) + + class ExecutionProperties(TaskExecutionProperties): + exclude_empty_inputs: bool = True + transform_string_to_json_valid: bool = True + + class WorkerDefinition(TaskDefinition): + name: str = "INVENTORY_delete_stream" + description: str = "Delete stream from inventory database" + labels: ListStr = ["BASICS", "MAIN", "INVENTORY", "STREAMS"] + timeout_seconds: int = 60 + response_timeout_seconds: int = 60 + + class WorkerInput(TaskInput): + stream_id: str = Field( + description="Identifier of the stream.", + ) + + class WorkerOutput(InventoryWorkerOutput): + ... + + def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: + self.delete_stream.id = worker_input.stream_id + query = self.delete_stream.render() + response = execute_inventory_query(query=query.query, variables=query.variable) + return response_handler(query, response) + + class InventoryGetStreamsInfo(WorkerImpl): + STREAMS: StreamConnection = StreamConnection( + pageInfo=PageInfo(hasNextPage=True, hasPreviousPage=True, startCursor=True, endCursor=True), + edges=StreamEdge( + node=Stream( + id=True, + createdAt=True, + updatedAt=True, + streamName=True, + deviceName=True, + isActive=True, + streamParameters=True, + blueprint=Blueprint( + id=True, + name=True, + ), + ), + cursor=True, + ), + totalCount=True, + ) + + class ExecutionProperties(TaskExecutionProperties): + exclude_empty_inputs: bool = True + + class WorkerDefinition(TaskDefinition): + name: str = "INVENTORY_get_streams_info" + description: str = "Read streams from inventory database" + labels: ListStr = ["BASIC", "INVENTORY", "STREAMS"] + + class WorkerInput(TaskInput): + stream_name: str | None = None + size: int | None = None + cursor: str | None = None + type: PaginationCursorType | None = None + + + class WorkerOutput(InventoryWorkerOutput): + ... + + def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]: + streams = StreamsQuery( + payload=self.STREAMS, + filter=FilterStreamsInput(streamName=worker_input.stream_name or None), + ) + + match worker_input.type: + case PaginationCursorType.AFTER: + streams.first = worker_input.size + streams.after = worker_input.cursor + case PaginationCursorType.BEFORE: + streams.last = worker_input.size + streams.before = worker_input.cursor + + query = streams.render() + response = execute_inventory_query(query=query.query, variables=query.variable) + return response_handler(query, response) + @staticmethod def _set_device_input_fields( query_input: UpdateDeviceInput | AddDeviceInput, diff --git a/inventory/python/poetry.lock b/inventory/python/poetry.lock index ba93d25..2811900 100644 --- a/inventory/python/poetry.lock +++ b/inventory/python/poetry.lock @@ -112,13 +112,13 @@ frozenlist = ">=1.1.0" [[package]] name = "annotated-types" -version = "0.6.0" +version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" files = [ - {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, - {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] [[package]] @@ -153,13 +153,13 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "certifi" -version = "2024.2.2" +version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, - {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, + {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, + {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, ] [[package]] @@ -263,7 +263,7 @@ files = [ [[package]] name = "frinx-inventory-api" -version = "2.0.1" +version = "2.1.0" description = "Frinx Inventory graphql schema transformed to pydantic basemodels" optional = false python-versions = "^3.10" @@ -277,19 +277,19 @@ pydantic = "^2" [package.source] type = "git" url = "https://github.com/FRINXio/frinx-services-python-api.git" -reference = "frinx-inventory-api_v2.0.1" -resolved_reference = "f52fdc5e32990917ed7e69a22d350938c2e78a6e" +reference = "frinx-inventory-api_v2.1.0" +resolved_reference = "15c08d532c6e58bccc7bc1fc5064f6549bad114e" subdirectory = "frinx-inventory-server/python" [[package]] name = "frinx-python-sdk" -version = "2.0.0" +version = "2.1.3" description = "Python SDK for Frinx Machine Workflow Manager" optional = false python-versions = "<4.0,>=3.10" files = [ - {file = "frinx_python_sdk-2.0.0-py3-none-any.whl", hash = "sha256:35728685c64c4c93d88b7a96b6bd1c35db0f85d169645218efa32afa269e19d9"}, - {file = "frinx_python_sdk-2.0.0.tar.gz", hash = "sha256:bc0f384df5e0e3c9dc0130eee8ea3fafb56dcf5f04f9dc9544bc0fb368d75952"}, + {file = "frinx_python_sdk-2.1.3-py3-none-any.whl", hash = "sha256:45f48a0b973a5137e718e48a1cdd031c06dd444aaabd3edf70902c296254f3de"}, + {file = "frinx_python_sdk-2.1.3.tar.gz", hash = "sha256:7a92362f3477a74da6532eadb11818b907386c43ce18ff0e106e444626a6571e"}, ] [package.dependencies] @@ -512,38 +512,38 @@ files = [ [[package]] name = "mypy" -version = "1.10.0" +version = "1.10.1" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:da1cbf08fb3b851ab3b9523a884c232774008267b1f83371ace57f412fe308c2"}, - {file = "mypy-1.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:12b6bfc1b1a66095ab413160a6e520e1dc076a28f3e22f7fb25ba3b000b4ef99"}, - {file = "mypy-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e36fb078cce9904c7989b9693e41cb9711e0600139ce3970c6ef814b6ebc2b2"}, - {file = "mypy-1.10.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2b0695d605ddcd3eb2f736cd8b4e388288c21e7de85001e9f85df9187f2b50f9"}, - {file = "mypy-1.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:cd777b780312ddb135bceb9bc8722a73ec95e042f911cc279e2ec3c667076051"}, - {file = "mypy-1.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3be66771aa5c97602f382230165b856c231d1277c511c9a8dd058be4784472e1"}, - {file = "mypy-1.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8b2cbaca148d0754a54d44121b5825ae71868c7592a53b7292eeb0f3fdae95ee"}, - {file = "mypy-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ec404a7cbe9fc0e92cb0e67f55ce0c025014e26d33e54d9e506a0f2d07fe5de"}, - {file = "mypy-1.10.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e22e1527dc3d4aa94311d246b59e47f6455b8729f4968765ac1eacf9a4760bc7"}, - {file = "mypy-1.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:a87dbfa85971e8d59c9cc1fcf534efe664d8949e4c0b6b44e8ca548e746a8d53"}, - {file = "mypy-1.10.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a781f6ad4bab20eef8b65174a57e5203f4be627b46291f4589879bf4e257b97b"}, - {file = "mypy-1.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b808e12113505b97d9023b0b5e0c0705a90571c6feefc6f215c1df9381256e30"}, - {file = "mypy-1.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f55583b12156c399dce2df7d16f8a5095291354f1e839c252ec6c0611e86e2e"}, - {file = "mypy-1.10.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4cf18f9d0efa1b16478c4c129eabec36148032575391095f73cae2e722fcf9d5"}, - {file = "mypy-1.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:bc6ac273b23c6b82da3bb25f4136c4fd42665f17f2cd850771cb600bdd2ebeda"}, - {file = "mypy-1.10.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9fd50226364cd2737351c79807775136b0abe084433b55b2e29181a4c3c878c0"}, - {file = "mypy-1.10.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f90cff89eea89273727d8783fef5d4a934be2fdca11b47def50cf5d311aff727"}, - {file = "mypy-1.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fcfc70599efde5c67862a07a1aaf50e55bce629ace26bb19dc17cece5dd31ca4"}, - {file = "mypy-1.10.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:075cbf81f3e134eadaf247de187bd604748171d6b79736fa9b6c9685b4083061"}, - {file = "mypy-1.10.0-cp38-cp38-win_amd64.whl", hash = "sha256:3f298531bca95ff615b6e9f2fc0333aae27fa48052903a0ac90215021cdcfa4f"}, - {file = "mypy-1.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fa7ef5244615a2523b56c034becde4e9e3f9b034854c93639adb667ec9ec2976"}, - {file = "mypy-1.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3236a4c8f535a0631f85f5fcdffba71c7feeef76a6002fcba7c1a8e57c8be1ec"}, - {file = "mypy-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a2b5cdbb5dd35aa08ea9114436e0d79aceb2f38e32c21684dcf8e24e1e92821"}, - {file = "mypy-1.10.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:92f93b21c0fe73dc00abf91022234c79d793318b8a96faac147cd579c1671746"}, - {file = "mypy-1.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:28d0e038361b45f099cc086d9dd99c15ff14d0188f44ac883010e172ce86c38a"}, - {file = "mypy-1.10.0-py3-none-any.whl", hash = "sha256:f8c083976eb530019175aabadb60921e73b4f45736760826aa1689dda8208aee"}, - {file = "mypy-1.10.0.tar.gz", hash = "sha256:3d087fcbec056c4ee34974da493a826ce316947485cef3901f511848e687c131"}, + {file = "mypy-1.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e36f229acfe250dc660790840916eb49726c928e8ce10fbdf90715090fe4ae02"}, + {file = "mypy-1.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:51a46974340baaa4145363b9e051812a2446cf583dfaeba124af966fa44593f7"}, + {file = "mypy-1.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:901c89c2d67bba57aaaca91ccdb659aa3a312de67f23b9dfb059727cce2e2e0a"}, + {file = "mypy-1.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0cd62192a4a32b77ceb31272d9e74d23cd88c8060c34d1d3622db3267679a5d9"}, + {file = "mypy-1.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:a2cbc68cb9e943ac0814c13e2452d2046c2f2b23ff0278e26599224cf164e78d"}, + {file = "mypy-1.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bd6f629b67bb43dc0d9211ee98b96d8dabc97b1ad38b9b25f5e4c4d7569a0c6a"}, + {file = "mypy-1.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a1bbb3a6f5ff319d2b9d40b4080d46cd639abe3516d5a62c070cf0114a457d84"}, + {file = "mypy-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8edd4e9bbbc9d7b79502eb9592cab808585516ae1bcc1446eb9122656c6066f"}, + {file = "mypy-1.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6166a88b15f1759f94a46fa474c7b1b05d134b1b61fca627dd7335454cc9aa6b"}, + {file = "mypy-1.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:5bb9cd11c01c8606a9d0b83ffa91d0b236a0e91bc4126d9ba9ce62906ada868e"}, + {file = "mypy-1.10.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d8681909f7b44d0b7b86e653ca152d6dff0eb5eb41694e163c6092124f8246d7"}, + {file = "mypy-1.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:378c03f53f10bbdd55ca94e46ec3ba255279706a6aacaecac52ad248f98205d3"}, + {file = "mypy-1.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bacf8f3a3d7d849f40ca6caea5c055122efe70e81480c8328ad29c55c69e93e"}, + {file = "mypy-1.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:701b5f71413f1e9855566a34d6e9d12624e9e0a8818a5704d74d6b0402e66c04"}, + {file = "mypy-1.10.1-cp312-cp312-win_amd64.whl", hash = "sha256:3c4c2992f6ea46ff7fce0072642cfb62af7a2484efe69017ed8b095f7b39ef31"}, + {file = "mypy-1.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:604282c886497645ffb87b8f35a57ec773a4a2721161e709a4422c1636ddde5c"}, + {file = "mypy-1.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37fd87cab83f09842653f08de066ee68f1182b9b5282e4634cdb4b407266bade"}, + {file = "mypy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8addf6313777dbb92e9564c5d32ec122bf2c6c39d683ea64de6a1fd98b90fe37"}, + {file = "mypy-1.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5cc3ca0a244eb9a5249c7c583ad9a7e881aa5d7b73c35652296ddcdb33b2b9c7"}, + {file = "mypy-1.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:1b3a2ffce52cc4dbaeee4df762f20a2905aa171ef157b82192f2e2f368eec05d"}, + {file = "mypy-1.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe85ed6836165d52ae8b88f99527d3d1b2362e0cb90b005409b8bed90e9059b3"}, + {file = "mypy-1.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c2ae450d60d7d020d67ab440c6e3fae375809988119817214440033f26ddf7bf"}, + {file = "mypy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6be84c06e6abd72f960ba9a71561c14137a583093ffcf9bbfaf5e613d63fa531"}, + {file = "mypy-1.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2189ff1e39db399f08205e22a797383613ce1cb0cb3b13d8bcf0170e45b96cc3"}, + {file = "mypy-1.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:97a131ee36ac37ce9581f4220311247ab6cba896b4395b9c87af0675a13a755f"}, + {file = "mypy-1.10.1-py3-none-any.whl", hash = "sha256:71d8ac0b906354ebda8ef1673e5fde785936ac1f29ff6987c7483cfbd5a4235a"}, + {file = "mypy-1.10.1.tar.gz", hash = "sha256:1f8f492d7db9e3593ef42d4f115f04e556130f2819ad33ab84551403e97dd4c0"}, ] [package.dependencies] @@ -570,18 +570,15 @@ files = [ [[package]] name = "nodeenv" -version = "1.8.0" +version = "1.9.1" description = "Node.js virtual environment builder" optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ - {file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"}, - {file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"}, + {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, + {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, ] -[package.dependencies] -setuptools = "*" - [[package]] name = "prometheus-client" version = "0.20.0" @@ -734,13 +731,13 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pyright" -version = "1.1.363" +version = "1.1.371" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.363-py3-none-any.whl", hash = "sha256:d3b8d73c8d230e26cc3523862f3398032a0c39a00d7bb69dc0f595f8e888fd01"}, - {file = "pyright-1.1.363.tar.gz", hash = "sha256:00a8f0ae0e339473bb0488f8a2a2dcdf574e94a16cd7b4390d49d144714d8db2"}, + {file = "pyright-1.1.371-py3-none-any.whl", hash = "sha256:cce52e42ff73943243e7e5e24f2a59dee81b97d99f4e3cf97370b27e8a1858cd"}, + {file = "pyright-1.1.371.tar.gz", hash = "sha256:777b508b92dda2db476214c400ce043aad8d8f3dd0e10d284c96e79f298308b5"}, ] [package.dependencies] @@ -752,13 +749,13 @@ dev = ["twine (>=3.4.1)"] [[package]] name = "requests" -version = "2.31.0" +version = "2.32.3" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, ] [package.dependencies] @@ -773,46 +770,31 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.4.4" +version = "0.5.1" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.4.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:29d44ef5bb6a08e235c8249294fa8d431adc1426bfda99ed493119e6f9ea1bf6"}, - {file = "ruff-0.4.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c4efe62b5bbb24178c950732ddd40712b878a9b96b1d02b0ff0b08a090cbd891"}, - {file = "ruff-0.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4c8e2f1e8fc12d07ab521a9005d68a969e167b589cbcaee354cb61e9d9de9c15"}, - {file = "ruff-0.4.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:60ed88b636a463214905c002fa3eaab19795679ed55529f91e488db3fe8976ab"}, - {file = "ruff-0.4.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b90fc5e170fc71c712cc4d9ab0e24ea505c6a9e4ebf346787a67e691dfb72e85"}, - {file = "ruff-0.4.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:8e7e6ebc10ef16dcdc77fd5557ee60647512b400e4a60bdc4849468f076f6eef"}, - {file = "ruff-0.4.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b9ddb2c494fb79fc208cd15ffe08f32b7682519e067413dbaf5f4b01a6087bcd"}, - {file = "ruff-0.4.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c51c928a14f9f0a871082603e25a1588059b7e08a920f2f9fa7157b5bf08cfe9"}, - {file = "ruff-0.4.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b5eb0a4bfd6400b7d07c09a7725e1a98c3b838be557fee229ac0f84d9aa49c36"}, - {file = "ruff-0.4.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b1867ee9bf3acc21778dcb293db504692eda5f7a11a6e6cc40890182a9f9e595"}, - {file = "ruff-0.4.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1aecced1269481ef2894cc495647392a34b0bf3e28ff53ed95a385b13aa45768"}, - {file = "ruff-0.4.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9da73eb616b3241a307b837f32756dc20a0b07e2bcb694fec73699c93d04a69e"}, - {file = "ruff-0.4.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:958b4ea5589706a81065e2a776237de2ecc3e763342e5cc8e02a4a4d8a5e6f95"}, - {file = "ruff-0.4.4-py3-none-win32.whl", hash = "sha256:cb53473849f011bca6e754f2cdf47cafc9c4f4ff4570003a0dad0b9b6890e876"}, - {file = "ruff-0.4.4-py3-none-win_amd64.whl", hash = "sha256:424e5b72597482543b684c11def82669cc6b395aa8cc69acc1858b5ef3e5daae"}, - {file = "ruff-0.4.4-py3-none-win_arm64.whl", hash = "sha256:39df0537b47d3b597293edbb95baf54ff5b49589eb7ff41926d8243caa995ea6"}, - {file = "ruff-0.4.4.tar.gz", hash = "sha256:f87ea42d5cdebdc6a69761a9d0bc83ae9b3b30d0ad78952005ba6568d6c022af"}, + {file = "ruff-0.5.1-py3-none-linux_armv6l.whl", hash = "sha256:6ecf968fcf94d942d42b700af18ede94b07521bd188aaf2cd7bc898dd8cb63b6"}, + {file = "ruff-0.5.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:204fb0a472f00f2e6280a7c8c7c066e11e20e23a37557d63045bf27a616ba61c"}, + {file = "ruff-0.5.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d235968460e8758d1e1297e1de59a38d94102f60cafb4d5382033c324404ee9d"}, + {file = "ruff-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38beace10b8d5f9b6bdc91619310af6d63dd2019f3fb2d17a2da26360d7962fa"}, + {file = "ruff-0.5.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e478d2f09cf06add143cf8c4540ef77b6599191e0c50ed976582f06e588c994"}, + {file = "ruff-0.5.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0368d765eec8247b8550251c49ebb20554cc4e812f383ff9f5bf0d5d94190b0"}, + {file = "ruff-0.5.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:3a9a9a1b582e37669b0138b7c1d9d60b9edac880b80eb2baba6d0e566bdeca4d"}, + {file = "ruff-0.5.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bdd9f723e16003623423affabcc0a807a66552ee6a29f90eddad87a40c750b78"}, + {file = "ruff-0.5.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:be9fd62c1e99539da05fcdc1e90d20f74aec1b7a1613463ed77870057cd6bd96"}, + {file = "ruff-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e216fc75a80ea1fbd96af94a6233d90190d5b65cc3d5dfacf2bd48c3e067d3e1"}, + {file = "ruff-0.5.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4c2112e9883a40967827d5c24803525145e7dab315497fae149764979ac7929"}, + {file = "ruff-0.5.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:dfaf11c8a116394da3b65cd4b36de30d8552fa45b8119b9ef5ca6638ab964fa3"}, + {file = "ruff-0.5.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d7ceb9b2fe700ee09a0c6b192c5ef03c56eb82a0514218d8ff700f6ade004108"}, + {file = "ruff-0.5.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:bac6288e82f6296f82ed5285f597713acb2a6ae26618ffc6b429c597b392535c"}, + {file = "ruff-0.5.1-py3-none-win32.whl", hash = "sha256:5c441d9c24ec09e1cb190a04535c5379b36b73c4bc20aa180c54812c27d1cca4"}, + {file = "ruff-0.5.1-py3-none-win_amd64.whl", hash = "sha256:b1789bf2cd3d1b5a7d38397cac1398ddf3ad7f73f4de01b1e913e2abc7dfc51d"}, + {file = "ruff-0.5.1-py3-none-win_arm64.whl", hash = "sha256:2875b7596a740cbbd492f32d24be73e545a4ce0a3daf51e4f4e609962bfd3cd2"}, + {file = "ruff-0.5.1.tar.gz", hash = "sha256:3164488aebd89b1745b47fd00604fb4358d774465f20d1fcd907f9c0fc1b0655"}, ] -[[package]] -name = "setuptools" -version = "69.5.1" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "setuptools-69.5.1-py3-none-any.whl", hash = "sha256:c636ac361bc47580504644275c9ad802c50415c7522212252c033bd15f301f32"}, - {file = "setuptools-69.5.1.tar.gz", hash = "sha256:6c1fccdac05a97e598fb0ae3bbed5904ccb317337a51139dcd51453611bbb987"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "tomli" version = "2.0.1" @@ -826,13 +808,13 @@ files = [ [[package]] name = "types-requests" -version = "2.31.0.20240406" +version = "2.32.0.20240622" description = "Typing stubs for requests" optional = false python-versions = ">=3.8" files = [ - {file = "types-requests-2.31.0.20240406.tar.gz", hash = "sha256:4428df33c5503945c74b3f42e82b181e86ec7b724620419a2966e2de604ce1a1"}, - {file = "types_requests-2.31.0.20240406-py3-none-any.whl", hash = "sha256:6216cdac377c6b9a040ac1c0404f7284bd13199c0e1bb235f4324627e8898cf5"}, + {file = "types-requests-2.32.0.20240622.tar.gz", hash = "sha256:ed5e8a412fcc39159d6319385c009d642845f250c63902718f605cd90faade31"}, + {file = "types_requests-2.32.0.20240622-py3-none-any.whl", hash = "sha256:97bac6b54b5bd4cf91d407e62f0932a74821bc2211f22116d9ee1dd643826caf"}, ] [package.dependencies] @@ -840,24 +822,24 @@ urllib3 = ">=2" [[package]] name = "typing-extensions" -version = "4.11.0" +version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"}, - {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"}, + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] name = "urllib3" -version = "2.2.1" +version = "2.2.2" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"}, - {file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"}, + {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, + {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, ] [package.extras] @@ -1053,4 +1035,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "c87424073746e6eed2b889ec6ca196d14f4e3f536140c80fb6d599066b0eacb3" +content-hash = "0c240876d6295da271eb039a59bdf5791ee088ac5d08bd76f7df1ca5d4835932" diff --git a/inventory/python/pyproject.toml b/inventory/python/pyproject.toml index 08c8dc1..35763d6 100644 --- a/inventory/python/pyproject.toml +++ b/inventory/python/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api" python = "^3.10" pydantic = "^2" frinx-python-sdk = "^2" -frinx-inventory-api = { git = "https://github.com/FRINXio/frinx-services-python-api.git", tag = "frinx-inventory-api_v2.0.1", subdirectory = "frinx-inventory-server/python" } +frinx-inventory-api = { git = "https://github.com/FRINXio/frinx-services-python-api.git", tag = "frinx-inventory-api_v2.1.0", subdirectory = "frinx-inventory-server/python" } [tool.poetry.group.dev.dependencies] ruff = "^0" @@ -19,7 +19,7 @@ packages = [{ include = "frinx_worker" }] name = "frinx-inventory-worker" description = "Conductor worker for Frinx Device Inventory" authors = ["Jozef Volak "] -version = "1.2.1" +version = "1.3.0" readme = ["README.md", "CHANGELOG.md", "RELEASE.md"] keywords = ["frinx-machine", "device inventory", "worker"] license = "Apache 2.0"