Project items
| Method | Description |
|---|---|
delete | Delete a project item by SID. |
restore_if_deleted | Restore a project item only when the API currently reports it deleted. |
list_project_items | List project items. |
iter_project_items | Iterate over project items. |
get_project_item | Get a project item by SID. |
get_project_item_from_link | Resolve a traceability link to a rich project item. |
delete
delete(sid: str) -> None
Delete a project item by SID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sid | str | The SID of the project item to delete. |
restore_if_deleted
restore_if_deleted(sid: str) -> ProjectItem
Restore a project item only when the API currently reports it deleted.
This method re-checks deletion status from the API instead of relying on local caller state. If the item is not deleted, it emits a warning and returns the current typed project item without sending a restore request.
list_project_items
list_project_items(
*,
name: str | None = None,
folder: Folder | str | None = None,
limit: int | None = None,
deleted: bool = False,
after: str | None = None
) -> Page[ProjectItem]
List project items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | None | Optional name filter. | None |
folder | Folder | str | None | Optional folder filter. | None |
limit | int | None | Maximum number of results to return. | None |
deleted | bool | Whether to include deleted project items. | False |
after | str | None | Pagination cursor. | None |
Returns:
Page[ProjectItem]: A page of ProjectItem objects.
iter_project_items
iter_project_items(
*,
name: str | None = None,
folder: Folder | str | None = None,
deleted: bool = False
) -> Iterator[ProjectItem]
Iterate over project items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | None | Optional name filter. | None |
folder | Folder | str | None | Optional folder filter. | None |
deleted | bool | Whether to include deleted project items. | False |
Yields:
ProjectItem: ProjectItem objects.
get_project_item
get_project_item(
sid: str, *, revision: int | None = None, allow_deleted: bool = False
) -> ProjectItem
Get a project item by SID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sid | str | The SID of the project item. | |
revision | int | None | Optional revision number. | None |
allow_deleted | bool | Whether to allow retrieving deleted project items. | False |
Returns:
ProjectItem: The requested ProjectItem.
get_project_item_from_link
get_project_item_from_link(
link: str, *, allow_deleted: bool = False
) -> ProjectItem
Resolve a traceability link to a rich project item.
Parses link to extract the first SID found, then fetches the
corresponding project item. The method is intentionally lenient: it
accepts full app URLs, bare /{sid} paths, API paths, and plain SIDs.
Two distinct warnings are emitted when relevant:
- Origin mismatch – the scheme+host of
linkdoes not match the client's configuredapp_url. The SID is still extracted and the fetch proceeds. - Extra query parameters – the URL contains query parameters beyond
the known navigation-only params (
cm_activeComponent,sc_activeComponent,revision). Those params are silently stripped; the warning lists which ones were dropped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
link | str | A URL or string containing a Jinko SID. May include query parameters, fragments, and any scheme/host. | |
allow_deleted | bool | Whether to allow retrieving deleted project items. | False |
Returns:
ProjectItem: The resolvedProjectItem.
Raises:
ValueError: If no SID can be found inlink.