Skip to main content

add_part_to_library

Function add_part_to_library 

Source
pub fn add_part_to_library(
    name: &str,
    source_key: &str,
    source_signature: &str,
    document_json: &str,
) -> Result<String, JsValue>
Expand description

INSERT: hand the opened sub-part document over to the library. Executes the document once, snapshots, stores the entry, and returns the EFFECTIVE part name (the ACOMP partName the app must reference):

  • a live entry with the same sourceKey AND sourceSignature is reused verbatim (no re-execution — instant re-insert, spec §2.1);
  • same sourceKey but a DIFFERENT signature gets a fresh entry under a disambiguated name (existing instances keep their version; the explicit refresh lane is refresh_library_entry);
  • a requested name taken by different content is disambiguated (name-2).