Store-backed PN<->LID mapping helpers aligned with Baileys' lookup rules.
User-level mappings are persisted in the :"lid-mapping" family using the
same forward/reverse keys Baileys writes (pn_user and lid_user_reverse).
Device-specific JIDs are derived at read time so Signal addressing preserves
per-device separation without duplicating stored rows.
Reverse PN lookup is intentionally limited to base @lid users, matching the
Baileys reference. Derived @hosted.lid device addresses are produced during
forward PN lookup, but are not treated as stored reverse-lookup identities.
Summary
Functions
Retrieves the single valid LID value mapped to a distinct phone number identifier.
Bulk-requests numerous LID identities tied to multiple phone numbers.
Obtains a Phone Number from an alias LID mapped node structure.
Loads multiple source Phone Numbers from Local Identifiers collectively.
Records active mapping correlations between Phone Numbers and Local Identifiers to the store engine.
Types
Functions
@spec get_lid_for_pn(BaileysEx.Signal.Store.t(), String.t(), keyword()) :: {:ok, String.t() | nil}
Retrieves the single valid LID value mapped to a distinct phone number identifier.
@spec get_lids_for_pns(BaileysEx.Signal.Store.t(), [String.t()], keyword()) :: {:ok, [mapping()] | nil}
Bulk-requests numerous LID identities tied to multiple phone numbers.
@spec get_pn_for_lid(BaileysEx.Signal.Store.t(), String.t()) :: {:ok, String.t() | nil}
Obtains a Phone Number from an alias LID mapped node structure.
@spec get_pns_for_lids(BaileysEx.Signal.Store.t(), [String.t()]) :: {:ok, [mapping()] | nil}
Loads multiple source Phone Numbers from Local Identifiers collectively.
@spec store_lid_pn_mappings(BaileysEx.Signal.Store.t(), [mapping()]) :: :ok | {:error, error()}
Records active mapping correlations between Phone Numbers and Local Identifiers to the store engine.