Members
Methods
# async mapToExternalIDs(internalIDs) → {Promise.<Record.<string, (string|null)>>}
Maps internal object IDs to their corresponding external IDs.
This method intentionally wraps and extends desiteAPI.mapToExternalIDs.
It should be used instead of the Desite API method whenever fallback
behavior is required.
Mapping logic:
- Attempt to map all internal IDs using
desiteAPI.mapToExternalIDs - For IDs without a direct external mapping:
- If the object is part of a composite (
cpIsPartOfComposite === true), inherit the external ID of its parent object - Otherwise, fall back to using the internal ID itself
- If the object is part of a composite (
This guarantees that every provided internal ID appears in the result object, even if no external ID exists.
Parameters:
| Name | Type | Description |
|---|---|---|
internalIDs |
Array.<string>
|
Array of internal object IDs to map |
- Since:
- 2025-12-16 RM
A promise resolving to an object where:
- keys are internal IDs
- values are external IDs, inherited parent external IDs,
the internal ID itself, or
nullif no mapping could be resolved
Promise.<Record.<string, (string|null)>>
# async resolveInternalId(objId) → {Promise.<string>}
Resolves the most appropriate internal ID for a given external object ID.
This method wraps desiteAPI.mapFromExternalIDs and applies additional
resolution rules when multiple internal IDs are mapped to the same
external ID.
Resolution logic:
- Map the external ID to internal IDs using
desiteAPI.mapFromExternalIDs - If no internal IDs are found, fall back to the original external ID
- If exactly one internal ID is found, return it
- If multiple internal IDs are found:
- Prefer the first ID whose domain is NOT
"building" - If all IDs belong to the
"building"domain, fall back to the first ID
- Prefer the first ID whose domain is NOT
This guarantees that the function always returns a usable ID.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
External object ID to resolve |
- Since:
- 2025-12-16 RM
A promise resolving to the selected internal ID,
or the original objId if no mapping could be resolved
Promise.<string>