BaileysEx.Protocol.Constants (baileys_ex v0.1.0-alpha.9)

Copy Markdown View Source

WhatsApp protocol dictionaries and tag constants for WABinary encoding/decoding.

Contains single-byte and double-byte token dictionaries that map indices to protocol strings, plus tag constants used in the binary wire format. These must match the Baileys reference exactly or the protocol breaks.

Summary

Functions

Broadcast lists structural JID namespace.

Fetches a specific token given the dictionary key index and array index.

Returns the tuple of all double byte tokens, organized in four inner dictionaries.

Group JID static namespace suffix.

LID identifier alias tag namespace.

Quickly checks if a valid single/double byte index mapping exists for a string token payload.

Newsletter broadcasts channel specification namespace.

Standard WhatsApp server domain identifier.

Finds a specific protocol token matching a single-byte index.

Returns the tuple list of single-byte tokens defined in Baileys.

Resolves a known protocol tag name to its integer index.

Returns the static tag mapping defined in Baileys.

Returns the precompiled map representation tying text token values directly back to their dictionaries and structural indexes.

Retrieves the byte identifier for a valid AD_JID tag namespace.

Dictionary of JID domain enumeration mappings.

Functions

broadcast()

@spec broadcast() :: String.t()

Broadcast lists structural JID namespace.

double_byte_token(dict, index)

@spec double_byte_token(non_neg_integer(), non_neg_integer()) :: String.t()

Fetches a specific token given the dictionary key index and array index.

double_byte_tokens()

@spec double_byte_tokens() :: {tuple(), tuple(), tuple(), tuple()}

Returns the tuple of all double byte tokens, organized in four inner dictionaries.

g_us()

@spec g_us() :: String.t()

Group JID static namespace suffix.

lid()

@spec lid() :: String.t()

LID identifier alias tag namespace.

lookup_token(str)

@spec lookup_token(String.t()) :: map() | nil

Quickly checks if a valid single/double byte index mapping exists for a string token payload.

newsletter()

@spec newsletter() :: String.t()

Newsletter broadcasts channel specification namespace.

s_whatsapp_net()

@spec s_whatsapp_net() :: String.t()

Standard WhatsApp server domain identifier.

single_byte_token(index)

@spec single_byte_token(non_neg_integer()) :: String.t() | nil

Finds a specific protocol token matching a single-byte index.

single_byte_tokens()

@spec single_byte_tokens() :: tuple()

Returns the tuple list of single-byte tokens defined in Baileys.

tag(name)

@spec tag(atom()) :: non_neg_integer()

Resolves a known protocol tag name to its integer index.

tags()

@spec tags() :: map()

Returns the static tag mapping defined in Baileys.

token_map()

@spec token_map() :: %{required(String.t()) => map()}

Returns the precompiled map representation tying text token values directly back to their dictionaries and structural indexes.

wajid_domain(name)

@spec wajid_domain(atom()) :: non_neg_integer()

Retrieves the byte identifier for a valid AD_JID tag namespace.

wajid_domains()

@spec wajid_domains() :: map()

Dictionary of JID domain enumeration mappings.