Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/uipath-platform/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-platform"
version = "0.1.61"
version = "0.1.62"
description = "HTTP client library for programmatic access to UiPath Platform"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ResourceType(str, Enum):
CONNECTOR = "connector"
MCP_SERVER = "mcpserver"
QUEUE = "queue"
ENTITY = "entity"

@classmethod
def from_string(cls, value: str) -> "ResourceType":
Expand Down
4 changes: 2 additions & 2 deletions packages/uipath-platform/uv.lock

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

48 changes: 45 additions & 3 deletions packages/uipath/tests/cli/test_create_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
VirtualResourceResult,
)
from uipath.platform.errors import EnrichedException, FolderNotFoundException
from uipath.platform.resource_catalog import ResourceType


def _enriched_exc(
Expand Down Expand Up @@ -270,8 +271,39 @@ async def test_unsupported_virtual_kind_is_skipped_with_warning(
bindings_file, mock_uipath, studio_client
):
"""Bindings whose kind the virtual endpoint cannot materialize (e.g.
'entity', 'choiceSet', 'webhook') should be skipped with a warning and
'choiceSet', 'webhook') should be skipped with a warning and
never reach create_virtual_resource."""
choiceset_binding = {
"resource": "choiceSet",
"key": "live.good.choiceset.Shared",
"value": {
"name": {
"defaultValue": "live.good.choiceset",
"isExpression": False,
"displayName": "Name",
},
"folderPath": {
"defaultValue": "Shared",
"isExpression": False,
"displayName": "Folder Path",
},
},
"metadata": None,
}
bindings_file(_make_bindings([choiceset_binding]))

await _run_create_resources(studio_client)

mock_uipath.resource_catalog.list_by_type_async.assert_not_called()
studio_client.create_virtual_resource.assert_not_awaited()
studio_client.create_referenced_resource.assert_not_awaited()


async def test_entity_binding_catalog_hit_creates_reference(
bindings_file, mock_uipath, studio_client
):
"""Entity bindings should go through the resource catalog lookup.
When found, a referenced resource should be created."""
entity_binding = {
"resource": "entity",
"key": "live.good.entity.Shared",
Expand All @@ -290,12 +322,22 @@ async def test_unsupported_virtual_kind_is_skipped_with_warning(
"metadata": None,
}
bindings_file(_make_bindings([entity_binding]))
mock_uipath.resource_catalog.list_by_type_async.return_value = _AsyncIterator(
[_found_resource(resource_type="entity", resource_sub_type="Native")]
)
studio_client.create_referenced_resource.return_value = SimpleNamespace(
status=Status.ADDED
)

await _run_create_resources(studio_client)

mock_uipath.resource_catalog.list_by_type_async.assert_not_called()
mock_uipath.resource_catalog.list_by_type_async.assert_called_once_with(
resource_type=ResourceType.ENTITY,
name="live.good.entity",
folder_path="Shared",
)
studio_client.create_referenced_resource.assert_awaited_once()
studio_client.create_virtual_resource.assert_not_awaited()
studio_client.create_referenced_resource.assert_not_awaited()


async def test_folder_not_found_falls_back_to_virtual(
Expand Down
4 changes: 2 additions & 2 deletions packages/uipath/uv.lock

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

Loading