Skip to content
Open
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
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,38 @@ uipath publish

Publishes the most recently created package to your UiPath Orchestrator.

### Declare Resources

```bash
uipath resources add InvoiceThreshold --kind asset --folder-path Finance/Shared --type integer
uipath resources add InvoiceReview --kind queue
uipath resources list
uipath resources remove InvoiceReview
uipath resources generate-bindings
```

Declares the platform resources the project uses in one place, `uipath_resources.py`:

```python
from uipath.resources import resource


class ProjectResources:
invoice_threshold = resource.asset(name="InvoiceThreshold", folder_path="Finance/Shared", type="integer")
invoice_review = resource.queue(name="InvoiceReview") # no folder: the project's own
```

The code passes a handle's fields to the SDK (`sdk.assets.retrieve(name=ProjectResources.invoice_threshold.name, folder_path=ProjectResources.invoice_threshold.folder_path)`). `uipath resources generate-bindings`, `uipath pack` and `uipath push` derive `bindings.json` from the file, keeping any hand-written entries, so the package carries exactly the bindings the code declares. The commands work offline; looking a resource up in the tenant and adding it to a solution is done by the `uip` CLI (`uip codedagent resources`, `uip function resources`), which forwards to these commands.

## Project Structure

To properly use the CLI for packaging and publishing, your project should include:

- A `pyproject.toml` file with project metadata
- A `uipath.json` file with your function definitions (e.g., `"functions": {"main": "main.py:main"}`)
- A `entry-points.json` file (generated by `uipath init`)
- A `bindings.json` file (generated by `uipath init`) to configure resource overrides
- A `bindings.json` file (generated by `uipath init`) to configure resource overrides; when the project has a `uipath_resources.py`, `uipath pack` and `uipath push` regenerate it from the declarations there
- Optionally a `uipath_resources.py` file declaring the platform resources the code uses (see `uipath resources`)
- Any Python files needed for your automation


Expand Down
1 change: 1 addition & 0 deletions packages/uipath-platform/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Services provide both sync and async variants (e.g., `.invoke()` and `.invoke_as
| `ontology/` | Ontology service: an ontology by id, its artifact files, its graph, SQL over its objects |
| `guardrails/` | LLM output guardrails |
| `resource_catalog/` | Resource discovery and metadata |
| `resources/` (`uipath.resources`, outside `uipath.platform`) | Typed handles for the resources a coded project declares in `uipath_resources.py` (`resource.asset(...)`, `resource.queue(...)`, one method per overridable kind); plain data the code passes to the SDK's methods. The `uipath` CLI reads that file as text and derives `bindings.json` from it |
| `resume_triggers/` | HITL trigger creation/reading protocols |
| `common/` | Shared base classes, config, auth, retry, paging, validation |
| `errors/` | Custom exceptions (`EnrichedException`, `FolderNotFoundException`, `BaseUrlMissingError`, etc.) |
Expand Down
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.3.22"
version = "0.3.23"
description = "HTTP client library for programmatic access to UiPath Platform"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
67 changes: 67 additions & 0 deletions packages/uipath-platform/src/uipath/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""Typed handles for the resources a coded project declares in ``uipath_resources.py``.

Example:
```python
from uipath.resources import resource

class ProjectResources:
invoice_threshold = resource.asset(
name="InvoiceThreshold", folder_path="Finance/Shared", type="integer"
)
review = resource.queue(name="Review")
```

Then, in the project's code::

sdk.assets.retrieve(
name=ProjectResources.invoice_threshold.name,
folder_path=ProjectResources.invoice_threshold.folder_path,
)

The ``uipath`` CLI (``uipath resources``) edits the file and derives the
project's ``bindings.json`` from it.
"""

from ._handles import (
ASSET_TYPES,
BUCKET_TYPES,
CONNECTION_KIND,
ENTITY_KIND,
GENERIC_KINDS,
KIND_METHODS,
METHOD_BY_KIND,
RESOURCE_KINDS,
SKILL_BUNDLE_KIND,
TYPED_KINDS,
ConnectionHandle,
EntityHandle,
Handle,
ResourceFactory,
ResourceHandle,
SkillBundleHandle,
binding_key,
normalize_folder_path,
resource,
)

__all__ = [
"ASSET_TYPES",
"BUCKET_TYPES",
"CONNECTION_KIND",
"ENTITY_KIND",
"GENERIC_KINDS",
"KIND_METHODS",
"METHOD_BY_KIND",
"RESOURCE_KINDS",
"SKILL_BUNDLE_KIND",
"TYPED_KINDS",
"ConnectionHandle",
"EntityHandle",
"Handle",
"ResourceFactory",
"ResourceHandle",
"SkillBundleHandle",
"binding_key",
"normalize_folder_path",
"resource",
]
Loading
Loading