Source: factory.core/ObjHook.py
Configuration constants for webhook operations
The ObjHook class is a specialized subclass of ObjApi.ObjApi designed to
handle webhook-related operations. It provides functionalities for
managing remote hooks, processing parameters, and preparing data for
outbound or inbound interactions. The class includes methods for handling
dynamic parameters, database interactions, and payload preparations, and
...
| Method | Signature | Description |
|---|---|---|
| sql_escape | sql_escape(value: str) -> str |
Override parent sql_escape to always use DB.escape_string for proper MySQL escaping. |
| validate_timeout | validate_timeout(timeout: str | int | None) -> int |
Validate and normalize timeout value. |
| get_cached_collation | get_cached_collation() -> str |
Get collation value with caching for performance. |
| get_cached_package_and_archetype | get_cached_package_and_archetype() -> tuple |
Get package and archetype with caching for performance. |
| record_metric | record_metric(metric_name: str, value: float = 1.0, tags: dict | None = None) -> None |
Record a metric for monitoring and observability. |
| get_metrics | get_metrics() -> dict |
Get all recorded metrics. |
| invalidate_webhook_credential_cache | invalidate_webhook_credential_cache() -> None |
Invalidate cached username/password/apikey for current webhook. |
| log_webhook_request | log_webhook_request(method: str, url: str, payload: Any, headers: dict | None, credential_source: str = '') -> None |
Publish structured webhook request log entry. |
| log_webhook_response | log_webhook_response(status_code: int, response_body: Any, duration: float, success: bool, error: str | None = None) -> None |
Publish structured webhook response log entry. |
| safe_debug | safe_debug(message: str, *args, **kwargs) -> None |
Debug logging with sensitive data masking. |
| patch_param | patch_param(text: str, depth: int = 0) -> str |
Optimized parameter replacement using regex for single-pass substitution. |
| pre_stage | pre_stage(guid: str) -> None |
|
| read | read(webhook_code: str = '', param1: str = '', param2: str = '', param3: str = '', param4: str = '', param5: str = '', param6: str = '', param7: str = '', param8: str = '', param9: str = '', context: JsonDictType | None = None) -> JsonDictType |
|
| reset_parameters | reset_parameters() -> None |
|
| process_param | process_param(param_type: ParamType, name: str) -> Any |
|
| param_trans | param_trans(param_type: str, name: str, repeat: int = 1, search_depth: int = 0) -> Any |
|
| encode_struct | encode_struct(level: int = 0, block_name: str = '', base_name: str = '', repeat = 1, encode_type: str = '') -> Any |
|
| encode_as_struct | encode_as_struct(struct_type = '', Level = 0, block_name = '', base_name = '') -> Any |
|
| bloom_return | bloom_return(context: JsonDictType) -> str |
|
| parse_data | parse_data(data_str: str) -> dict |
Parses a string as JSON, or falls back to Python literal dict. |
| sql_parse_heading | sql_parse_heading(sql: str) -> list[str] |
Parses a SQL SELECT statement to extract column headings/aliases using sqlglot. |
| factory_hook | factory_hook(module: str) -> Any |
|
| check_id_number | check_id_number(status: str) -> str |
|
| prep_data | prep_data(guid: str = '') -> int | str |
|
| ValidatePayload | ValidatePayload() -> tuple |
|
| categorise_payload_out | categorise_payload_out() -> None |
|
| restage_timeout | restage_timeout(Guid, StatusError) -> str |
|
| provision_parameters | provision_parameters(context: dict, r: dict) -> None |
|
| call | call(call_status: str, guid: str = '') -> dict |
| Method | Signature | Description |
|---|---|---|
| Create | Create() -> None |
|
| read | read(guid: str, context: dict = {}) -> dict |
|
| export_openapi | export_openapi(webhook_code = '') -> None |
|
| pre_call | pre_call() -> None |
|
| run_direct | run_direct(context = []) -> None |
|
| launch_service | launch_service(role: str = '') -> None |
|
| micro_service | micro_service(role: str = '', guid = '') -> None |
|
| Payload | Payload() -> None |
Supplements inbound webhook parameters in