Delay
Introduces a delay in execution.Parameters:
milliseconds(number): Duration of delay in milliseconds
Promise<void>Blacklist Management
Manages blocked phone numbers. Also supports whitelist mode.Parameters:
Constructor
initialNumbers(string[]): Optional array of numbers to block initially
Methods
add
add
Add number(s) to the blacklist.Parameters:
phoneNumbers(string | string[]): Phone number(s) to block
string[] - Response messagesremove
remove
Remove a number from the blacklist.Parameters:
phoneNumber(string): Phone number to unblock
voidThrows: Error if number is not in blacklistcheckIf
checkIf
Check if a number is blocked.Parameters:
phoneNumber(string): Phone number to check
boolean - true if blockedgetList
getList
Get all numbers in the blacklist.Returns:
string[]Whitelist Mode
Prefix numbers with! to enable whitelist mode (only allow those numbers):
File Downloads
Downloads files from URLs or copies local files.Parameters:
url(string): URL or local file pathpathToSave(string): Optional directory path (defaults to system temp)headers(object): Optional HTTP headers
Promise<string> - Path to downloaded fileHashing & Encryption
Generates a unique UUID, optionally with a prefix.Parameters:
prefix(string): Optional prefix for the UUID
stringGenerates current timestamp in milliseconds.Returns:
numberEncrypts data using AES-256-CBC.Parameters:
data(string): Data to encrypt
string - Base64 encoded encrypted dataDecrypts AES-256-CBC encrypted data.Parameters:
encryptedData(string): Base64 encoded encrypted data
string - Decrypted data or ‘FAIL’ on errorQueue Management
Manages concurrent task execution with limits.Constructor Parameters:
logger(Console): Logger instanceconcurrencyLimit(number): Max concurrent taskstimeout(number): Task timeout in milliseconds
Phone Number Utilities
Removes plus sign and spaces from phone numbers.Parameters:
phone(string): Phone number with + prefix
string - Cleaned phone number