Skip to main content

Module items

Module items 

Source
Expand description

Items (parts, assemblies, documents, software) and their search.

Structs§

ItemFilter
NewItem

Constants§

MAX_IDEMPOTENCY_KEY
The longest idempotency key accepted.
MAX_WHERE_USED_LEVELS
Most levels a multi-level where-used report walks up.
MAX_WHERE_USED_ROWS
Most usages a multi-level where-used report returns.

Functions§

create
Creates an item together with its first revision A (in work) and returns that revision.
create_idempotent
create with an idempotency key: the first request with a key creates the item; a repetition by the same user with the same payload_hash returns that item (second value true, nothing is created); the same key with another payload is a conflict (409).
create_with_files
Creates an item and stores its first files in the new revision – one transaction, so there is never an item without the files it was created with. The revision stays checked out by the creator.
delete
Deletes an item created by mistake. Only allowed while it has a single in-work revision, is not used in any BOM, not part of any change, no simulation basis, no design that units were built to and – in a restricted group – no affected item of a change request.
get
An item the actor may read; hidden items answer like missing ones.
get_by_number
An item by number, if the actor may read it. A hidden item gives exactly the message of an unknown number.
hidden_parents
Number of distinct parent items that use the item but that the actor may not read (“+N assemblies in groups you cannot see”).
latest_revision
The latest revision of an item the actor may read.
open_revision
The in-work or in-review revision of an item the actor may read.
revisions
All revisions of an item the actor may read, newest first.
search
Searches items the actor may read; every row carries its latest revision.
update_master
Updates item master data. The unit can only change while nothing has been released yet, because released BOMs depend on it.
validate_idempotency_key
Validates a client-supplied idempotency key (printable ASCII, 1..=255).
where_used
Parent revisions whose BOM contains the item, at most limit (a standard part can be used in tens of thousands of BOMs) – only parents the actor may read (see hidden_parents for the rest).
where_used_levels
Multi-level where-used: every BOM line that uses the item or (up to levels levels up) one of its parents. Like the single-level report it looks at the BOMs of all revisions. Each item is reported on the lowest level it is reached on: the walk goes up one level per query (the parents not seen before form the next level), so a part used in thousands of assemblies costs one query per level instead of a recursive expansion of every path. The report stops at MAX_WHERE_USED_ROWS rows.