Terarea  2
The automation project
Loading...
Searching...
No Matches
src.lib.actions.constants Namespace Reference

Functions

int _spaceship (a, b)
 
bool check_if_oauth_is_valid (str oauth_token)
 
Union[int, float, bool, None, datetime, date, str] detect_and_convert (str value)
 

Variables

str TYPE_UNKNOWN = "UNKNOWN LOGGING TYPE"
 
str TYPE_API = "API"
 
str TYPE_SERVICE = "SERVICE"
 
str TYPE_SERVICE_TRIGGER = "SERVICE TRIGGER"
 
str TYPE_SERVICE_ACTION = "SERVICE ACTION"
 
str TYPE_ACTION = "ACTION"
 
str TYPE_UNDEFINED = "UNDEFINED"
 
str TYPE_MISMATCH = "MISMATCH"
 
str TYPE_BEFORE_ASSIGNEMENT = "REFERENCED BEFORE ASSIGNEMENT"
 
str TYPE_DIV_ZERO = "DIVISION BY ZERO"
 
str TYPE_SYNTAX_ERROR = "SYNTAX ERROR"
 
str TYPE_RUNTIME_ERROR = "RUNTIME ERROR"
 
str TYPE_INCOMPARABLE = "INCOMPARABLE TYPES"
 
str TYPE_OVERFLOW = "VALUE OVERFLOW"
 
str TYPE_UNDERFLOW = "VALUE UNDERFLOW"
 
int CODE_UNKNOWN = -1
 
int CODE_INFO = 0
 
int CODE_SUCCESS = 1
 
int CODE_DEBUG = 2
 
int CODE_WARNING = 3
 
int CODE_ERROR = 4
 
int CODE_CRITICAL = 5
 
int CODE_FATAL = 6
 
str LEVEL_UNKNOWN = "UNKNOWN"
 
str LEVEL_INFO = "INFO"
 
str LEVEL_SUCCESS = "SUCCESS"
 
str LEVEL_DEBUG = "DEBUG"
 
str LEVEL_WARNING = "WARNING"
 
str LEVEL_ERROR = "ERROR"
 
str LEVEL_CRITICAL = "CRITICAL"
 
str LEVEL_FATAL = "FATAL"
 
str MSG_UNKNOWN = "Unknown: Operation executed with unknown status."
 
str MSG_INFO = "Information: Operation executed without any issues."
 
str MSG_SUCCESS = "Success: Operation completed successfully."
 
str MSG_DEBUG = "Debug: Tracking detailed operational data for diagnostics."
 
str MSG_WARNING = "Warning: Potential issue detected. Review is recommended."
 
str MSG_ERROR = "Error: Operation could not be completed successfully."
 
str MSG_CRITICAL = "Critical: Immediate attention required to prevent severe impact."
 
str MSG_FATAL = "Fatal: System failure imminent. Immediate intervention necessary."
 
dict LOG_EQUIVALENCE
 
dict LOG_MESSAGE_EQUIVALENCE
 
list LIST_TYPE
 
list LIST_CODE
 
list LIST_LEVEL_INFO
 
list LIST_MSG
 
dict OPERATOR_EXCHANGE
 
dict SECRETS_EQUIVALENCE
 
str CONTENT_TYPE_KEY = "type"
 
str CONTENT_KEY = "content"
 
dict CONTENT_TYPES_JSON = {"application/json", "application/ld+json"}
 
dict CONTENT_TYPES_TEXT
 
dict CONTENT_TYPES_XML = {"application/xml", "application/xhtml+xml", "text/xml"}
 
dict CONTENT_TYPES_BINARY
 
dict CONTENT_TYPES_AUDIO
 
dict CONTENT_TYPES_IMAGES
 
dict CONTENT_TYPES_VIDEO
 
str RESPONSE_NODE_BODY_KEY = "body"
 
str RESPONSE_NODE_BODY_TYPE_KEY = "body_type"
 
str RESPONSE_NODE_HEADERS_KEY = "headers"
 
str RESPONSE_NODE_HEADERS_TYPE_KEY = "headers_type"
 
str RESPONSE_NODE_ENCODING_KEY = "encoding"
 
str RESPONSE_NODE_HISTORY_KEY = "history"
 
str RESPONSE_NODE_COOKIES_KEY = "cookies"
 
str RESPONSE_NODE_ELAPSED_KEY = "elapsed"
 
str RESPONSE_NODE_REASON_KEY = "reason"
 
str RESPONSE_NODE_URL_KEY = "url"
 
str RESPONSE_NODE_METHOD_KEY = "method"
 
str RESPONSE_NODE_STATUS_CODE_KEY = "status_code"
 
dict RESPONSE_NODE_KEY_EQUIVALENCE
 
list BRUTEFORCE_DATETIME_FORMATS
 
list BRUTEFORCE_DATE_FORMATS
 

Detailed Description

_summary_
    This file contains the constants for the actions program.
    These are used to standardise error logging and other sections of the program.

Function Documentation

◆ _spaceship()

int src.lib.actions.constants._spaceship ( a,
b )
protected
Compares two values and returns:
    -1 if a < b
     0 if a == b
     1 if a > b

Args:
    a: The first value to compare.
    b: The second value to compare.

Returns:
    int: -1, 0, or 1 based on the comparison.

Definition at line 142 of file constants.py.

◆ check_if_oauth_is_valid()

bool src.lib.actions.constants.check_if_oauth_is_valid ( str oauth_token)

Definition at line 399 of file constants.py.

◆ detect_and_convert()

Union[int, float, bool, None, datetime, date, str] src.lib.actions.constants.detect_and_convert ( str value)
Detects the type of the input string and converts it to the appropriate Python type.

Args:
    value (str): The string to be converted.

Returns:
    int, float, bool, None, datetime, date, or str: The converted value based on its detected type.

Definition at line 426 of file constants.py.

Variable Documentation

◆ BRUTEFORCE_DATE_FORMATS

list src.lib.actions.constants.BRUTEFORCE_DATE_FORMATS
Initial value:
1= [
2 "%Y-%m-%d",
3 "%d/%m/%Y",
4 "%m/%d/%Y"
5]

Definition at line 419 of file constants.py.

◆ BRUTEFORCE_DATETIME_FORMATS

list src.lib.actions.constants.BRUTEFORCE_DATETIME_FORMATS
Initial value:
1= [
2 "%Y-%m-%dT%H:%M:%S.%f%z",
3 "%Y-%m-%dT%H:%M:%S%z",
4 "%Y-%m-%dT%H:%M:%S",
5 "%Y-%m-%d %H:%M:%S"
6]

Definition at line 412 of file constants.py.

◆ CODE_CRITICAL

int src.lib.actions.constants.CODE_CRITICAL = 5

Definition at line 37 of file constants.py.

◆ CODE_DEBUG

int src.lib.actions.constants.CODE_DEBUG = 2

Definition at line 34 of file constants.py.

◆ CODE_ERROR

int src.lib.actions.constants.CODE_ERROR = 4

Definition at line 36 of file constants.py.

◆ CODE_FATAL

int src.lib.actions.constants.CODE_FATAL = 6

Definition at line 38 of file constants.py.

◆ CODE_INFO

int src.lib.actions.constants.CODE_INFO = 0

Definition at line 32 of file constants.py.

◆ CODE_SUCCESS

int src.lib.actions.constants.CODE_SUCCESS = 1

Definition at line 33 of file constants.py.

◆ CODE_UNKNOWN

int src.lib.actions.constants.CODE_UNKNOWN = -1

Definition at line 31 of file constants.py.

◆ CODE_WARNING

int src.lib.actions.constants.CODE_WARNING = 3

Definition at line 35 of file constants.py.

◆ CONTENT_KEY

str src.lib.actions.constants.CONTENT_KEY = "content"

Definition at line 228 of file constants.py.

◆ CONTENT_TYPE_KEY

str src.lib.actions.constants.CONTENT_TYPE_KEY = "type"

Definition at line 227 of file constants.py.

◆ CONTENT_TYPES_AUDIO

dict src.lib.actions.constants.CONTENT_TYPES_AUDIO
Initial value:
1= {
2 "audio/midi",
3 "audio/mpeg",
4 "audio/webm",
5 "audio/ogg",
6 "audio/wav",
7 "audio/flac",
8 "audio/aac",
9 "audio/mp4",
10 "audio/opus",
11 "audio/x-ms-wma",
12 "audio/vnd.rn-realaudio"
13}

Definition at line 305 of file constants.py.

◆ CONTENT_TYPES_BINARY

dict src.lib.actions.constants.CONTENT_TYPES_BINARY

Definition at line 239 of file constants.py.

◆ CONTENT_TYPES_IMAGES

dict src.lib.actions.constants.CONTENT_TYPES_IMAGES
Initial value:
1= {
2 "image/gif",
3 "image/jpeg",
4 "image/png",
5 "image/webp",
6 "image/svg+xml",
7 "image/bmp",
8 "image/vnd.microsoft.icon",
9 "image/tiff",
10 "image/x-icon",
11 "image/vnd.djvu"
12}

Definition at line 318 of file constants.py.

◆ CONTENT_TYPES_JSON

dict src.lib.actions.constants.CONTENT_TYPES_JSON = {"application/json", "application/ld+json"}

Definition at line 230 of file constants.py.

◆ CONTENT_TYPES_TEXT

dict src.lib.actions.constants.CONTENT_TYPES_TEXT
Initial value:
1= {
2 "text/html",
3 "text/plain",
4 "text/csv",
5 "text/xml",
6 "text/css"
7}

Definition at line 231 of file constants.py.

◆ CONTENT_TYPES_VIDEO

dict src.lib.actions.constants.CONTENT_TYPES_VIDEO
Initial value:
1= {
2 "video/mpeg",
3 "video/mp4",
4 "video/quicktime",
5 "video/x-ms-wmv",
6 "video/x-msvideo",
7 "video/x-flv",
8 "video/webm"
9}

Definition at line 330 of file constants.py.

◆ CONTENT_TYPES_XML

dict src.lib.actions.constants.CONTENT_TYPES_XML = {"application/xml", "application/xhtml+xml", "text/xml"}

Definition at line 238 of file constants.py.

◆ LEVEL_CRITICAL

str src.lib.actions.constants.LEVEL_CRITICAL = "CRITICAL"

Definition at line 48 of file constants.py.

◆ LEVEL_DEBUG

str src.lib.actions.constants.LEVEL_DEBUG = "DEBUG"

Definition at line 45 of file constants.py.

◆ LEVEL_ERROR

str src.lib.actions.constants.LEVEL_ERROR = "ERROR"

Definition at line 47 of file constants.py.

◆ LEVEL_FATAL

str src.lib.actions.constants.LEVEL_FATAL = "FATAL"

Definition at line 49 of file constants.py.

◆ LEVEL_INFO

str src.lib.actions.constants.LEVEL_INFO = "INFO"

Definition at line 43 of file constants.py.

◆ LEVEL_SUCCESS

str src.lib.actions.constants.LEVEL_SUCCESS = "SUCCESS"

Definition at line 44 of file constants.py.

◆ LEVEL_UNKNOWN

str src.lib.actions.constants.LEVEL_UNKNOWN = "UNKNOWN"

Definition at line 42 of file constants.py.

◆ LEVEL_WARNING

str src.lib.actions.constants.LEVEL_WARNING = "WARNING"

Definition at line 46 of file constants.py.

◆ LIST_CODE

list src.lib.actions.constants.LIST_CODE
Initial value:
1= [
2 CODE_UNKNOWN,
3 CODE_INFO,
4 CODE_SUCCESS,
5 CODE_DEBUG,
6 CODE_WARNING,
7 CODE_ERROR,
8 CODE_CRITICAL,
9 CODE_FATAL
10]

Definition at line 106 of file constants.py.

◆ LIST_LEVEL_INFO

list src.lib.actions.constants.LIST_LEVEL_INFO
Initial value:
1= [
2 LEVEL_UNKNOWN,
3 LEVEL_INFO,
4 LEVEL_SUCCESS,
5 LEVEL_DEBUG,
6 LEVEL_WARNING,
7 LEVEL_ERROR,
8 LEVEL_CRITICAL,
9 LEVEL_FATAL
10]

Definition at line 117 of file constants.py.

◆ LIST_MSG

list src.lib.actions.constants.LIST_MSG
Initial value:
1= [
2 MSG_UNKNOWN,
3 MSG_INFO,
4 MSG_SUCCESS,
5 MSG_DEBUG,
6 MSG_WARNING,
7 MSG_ERROR,
8 MSG_CRITICAL,
9 MSG_FATAL
10]

Definition at line 128 of file constants.py.

◆ LIST_TYPE

list src.lib.actions.constants.LIST_TYPE
Initial value:
1= [
2 TYPE_UNKNOWN,
3 TYPE_API,
4 TYPE_SERVICE,
5 TYPE_SERVICE_TRIGGER,
6 TYPE_SERVICE_ACTION,
7 TYPE_ACTION,
8 TYPE_UNDEFINED,
9 TYPE_MISMATCH,
10 TYPE_BEFORE_ASSIGNEMENT,
11 TYPE_DIV_ZERO,
12 TYPE_SYNTAX_ERROR,
13 TYPE_RUNTIME_ERROR,
14 TYPE_INCOMPARABLE,
15 TYPE_OVERFLOW,
16 TYPE_UNDERFLOW
17]

Definition at line 88 of file constants.py.

◆ LOG_EQUIVALENCE

dict src.lib.actions.constants.LOG_EQUIVALENCE
Initial value:
1= {
2 CODE_UNKNOWN: LEVEL_UNKNOWN,
3 CODE_INFO: LEVEL_INFO,
4 CODE_SUCCESS: LEVEL_SUCCESS,
5 CODE_DEBUG: LEVEL_DEBUG,
6 CODE_WARNING: LEVEL_WARNING,
7 CODE_ERROR: LEVEL_ERROR,
8 CODE_CRITICAL: LEVEL_CRITICAL,
9 CODE_FATAL: LEVEL_FATAL,
10}

Definition at line 64 of file constants.py.

◆ LOG_MESSAGE_EQUIVALENCE

dict src.lib.actions.constants.LOG_MESSAGE_EQUIVALENCE
Initial value:
1= {
2 CODE_UNKNOWN: MSG_UNKNOWN,
3 CODE_INFO: MSG_INFO,
4 CODE_SUCCESS: MSG_SUCCESS,
5 CODE_DEBUG: MSG_DEBUG,
6 CODE_WARNING: MSG_WARNING,
7 CODE_ERROR: MSG_ERROR,
8 CODE_CRITICAL: MSG_CRITICAL,
9 CODE_FATAL: MSG_FATAL,
10}

Definition at line 75 of file constants.py.

◆ MSG_CRITICAL

str src.lib.actions.constants.MSG_CRITICAL = "Critical: Immediate attention required to prevent severe impact."

Definition at line 59 of file constants.py.

◆ MSG_DEBUG

str src.lib.actions.constants.MSG_DEBUG = "Debug: Tracking detailed operational data for diagnostics."

Definition at line 56 of file constants.py.

◆ MSG_ERROR

str src.lib.actions.constants.MSG_ERROR = "Error: Operation could not be completed successfully."

Definition at line 58 of file constants.py.

◆ MSG_FATAL

str src.lib.actions.constants.MSG_FATAL = "Fatal: System failure imminent. Immediate intervention necessary."

Definition at line 60 of file constants.py.

◆ MSG_INFO

str src.lib.actions.constants.MSG_INFO = "Information: Operation executed without any issues."

Definition at line 54 of file constants.py.

◆ MSG_SUCCESS

str src.lib.actions.constants.MSG_SUCCESS = "Success: Operation completed successfully."

Definition at line 55 of file constants.py.

◆ MSG_UNKNOWN

str src.lib.actions.constants.MSG_UNKNOWN = "Unknown: Operation executed with unknown status."

Definition at line 53 of file constants.py.

◆ MSG_WARNING

str src.lib.actions.constants.MSG_WARNING = "Warning: Potential issue detected. Review is recommended."

Definition at line 57 of file constants.py.

◆ OPERATOR_EXCHANGE

dict src.lib.actions.constants.OPERATOR_EXCHANGE
Initial value:
1= {
2 "==": operator.eq,
3 "===": operator.eq,
4 "=": operator.eq, # Bash string equality
5 "eq": operator.eq,
6 "-eq": operator.eq,
7 "!=": operator.ne,
8 "<>": operator.ne, # Not equal in SQL-like contexts
9 "ne": operator.ne,
10 "-ne": operator.ne,
11 "<": operator.lt,
12 "lt": operator.lt,
13 "-lt": operator.lt,
14 ">": operator.gt,
15 "gt": operator.gt,
16 "-gt": operator.gt,
17 "<=": operator.le,
18 "le": operator.le,
19 "-le": operator.le,
20 ">=": operator.ge,
21 "ge": operator.ge,
22 "-ge": operator.ge,
23 "<=>": _spaceship, # Custom spaceship operator
24 "equal to": operator.eq,
25 "less than": operator.lt,
26 "not equal to": operator.ne,
27 "greater than": operator.gt,
28 "less than or equal to": operator.le,
29 "greater than or equal to": operator.ge,
30}

Definition at line 162 of file constants.py.

◆ RESPONSE_NODE_BODY_KEY

str src.lib.actions.constants.RESPONSE_NODE_BODY_KEY = "body"

Definition at line 341 of file constants.py.

◆ RESPONSE_NODE_BODY_TYPE_KEY

str src.lib.actions.constants.RESPONSE_NODE_BODY_TYPE_KEY = "body_type"

Definition at line 342 of file constants.py.

◆ RESPONSE_NODE_COOKIES_KEY

str src.lib.actions.constants.RESPONSE_NODE_COOKIES_KEY = "cookies"

Definition at line 347 of file constants.py.

◆ RESPONSE_NODE_ELAPSED_KEY

str src.lib.actions.constants.RESPONSE_NODE_ELAPSED_KEY = "elapsed"

Definition at line 348 of file constants.py.

◆ RESPONSE_NODE_ENCODING_KEY

str src.lib.actions.constants.RESPONSE_NODE_ENCODING_KEY = "encoding"

Definition at line 345 of file constants.py.

◆ RESPONSE_NODE_HEADERS_KEY

str src.lib.actions.constants.RESPONSE_NODE_HEADERS_KEY = "headers"

Definition at line 343 of file constants.py.

◆ RESPONSE_NODE_HEADERS_TYPE_KEY

str src.lib.actions.constants.RESPONSE_NODE_HEADERS_TYPE_KEY = "headers_type"

Definition at line 344 of file constants.py.

◆ RESPONSE_NODE_HISTORY_KEY

str src.lib.actions.constants.RESPONSE_NODE_HISTORY_KEY = "history"

Definition at line 346 of file constants.py.

◆ RESPONSE_NODE_KEY_EQUIVALENCE

dict src.lib.actions.constants.RESPONSE_NODE_KEY_EQUIVALENCE

Definition at line 354 of file constants.py.

◆ RESPONSE_NODE_METHOD_KEY

str src.lib.actions.constants.RESPONSE_NODE_METHOD_KEY = "method"

Definition at line 351 of file constants.py.

◆ RESPONSE_NODE_REASON_KEY

str src.lib.actions.constants.RESPONSE_NODE_REASON_KEY = "reason"

Definition at line 349 of file constants.py.

◆ RESPONSE_NODE_STATUS_CODE_KEY

str src.lib.actions.constants.RESPONSE_NODE_STATUS_CODE_KEY = "status_code"

Definition at line 352 of file constants.py.

◆ RESPONSE_NODE_URL_KEY

str src.lib.actions.constants.RESPONSE_NODE_URL_KEY = "url"

Definition at line 350 of file constants.py.

◆ SECRETS_EQUIVALENCE

dict src.lib.actions.constants.SECRETS_EQUIVALENCE
Initial value:
1= {
2 "secrets.now": Secrets.now_server,
3 "secrets.current_date": Secrets.current_date,
4 "secrets.current_time": Secrets.current_time,
5 "secrets.now_utc": Secrets.now_utc,
6 "secrets.current_date_utc": Secrets.current_date_utc,
7 "secrets.current_time_utc": Secrets.current_time_utc,
8 "secrets.now_server": Secrets.now_server,
9 "secrets.current_date_server": Secrets.current_date_server,
10 "secrets.current_time_server": Secrets.current_time_server,
11 "secret.now": Secrets.now_server,
12 "secret.current_date": Secrets.current_date,
13 "secret.current_time": Secrets.current_time,
14 "secret.now_utc": Secrets.now_utc,
15 "secret.current_date_utc": Secrets.current_date_utc,
16 "secret.current_time_utc": Secrets.current_time_utc,
17 "secret.now_server": Secrets.now_server,
18 "secret.current_date_server": Secrets.current_date_server,
19 "secret.current_time_server": Secrets.current_time_server,
20 "now": Secrets.now_server,
21 "current_date": Secrets.current_date,
22 "current_time": Secrets.current_time,
23 "now_utc": Secrets.now_utc,
24 "current_date_utc": Secrets.current_date_utc,
25 "current_time_utc": Secrets.current_time_utc,
26 "now_server": Secrets.now_server,
27 "current_date_server": Secrets.current_date_server,
28 "current_time_server": Secrets.current_time_server
29}

Definition at line 194 of file constants.py.

◆ TYPE_ACTION

str src.lib.actions.constants.TYPE_ACTION = "ACTION"

Definition at line 18 of file constants.py.

◆ TYPE_API

str src.lib.actions.constants.TYPE_API = "API"

Definition at line 14 of file constants.py.

◆ TYPE_BEFORE_ASSIGNEMENT

str src.lib.actions.constants.TYPE_BEFORE_ASSIGNEMENT = "REFERENCED BEFORE ASSIGNEMENT"

Definition at line 21 of file constants.py.

◆ TYPE_DIV_ZERO

str src.lib.actions.constants.TYPE_DIV_ZERO = "DIVISION BY ZERO"

Definition at line 22 of file constants.py.

◆ TYPE_INCOMPARABLE

str src.lib.actions.constants.TYPE_INCOMPARABLE = "INCOMPARABLE TYPES"

Definition at line 25 of file constants.py.

◆ TYPE_MISMATCH

str src.lib.actions.constants.TYPE_MISMATCH = "MISMATCH"

Definition at line 20 of file constants.py.

◆ TYPE_OVERFLOW

str src.lib.actions.constants.TYPE_OVERFLOW = "VALUE OVERFLOW"

Definition at line 26 of file constants.py.

◆ TYPE_RUNTIME_ERROR

str src.lib.actions.constants.TYPE_RUNTIME_ERROR = "RUNTIME ERROR"

Definition at line 24 of file constants.py.

◆ TYPE_SERVICE

str src.lib.actions.constants.TYPE_SERVICE = "SERVICE"

Definition at line 15 of file constants.py.

◆ TYPE_SERVICE_ACTION

str src.lib.actions.constants.TYPE_SERVICE_ACTION = "SERVICE ACTION"

Definition at line 17 of file constants.py.

◆ TYPE_SERVICE_TRIGGER

str src.lib.actions.constants.TYPE_SERVICE_TRIGGER = "SERVICE TRIGGER"

Definition at line 16 of file constants.py.

◆ TYPE_SYNTAX_ERROR

str src.lib.actions.constants.TYPE_SYNTAX_ERROR = "SYNTAX ERROR"

Definition at line 23 of file constants.py.

◆ TYPE_UNDEFINED

str src.lib.actions.constants.TYPE_UNDEFINED = "UNDEFINED"

Definition at line 19 of file constants.py.

◆ TYPE_UNDERFLOW

str src.lib.actions.constants.TYPE_UNDERFLOW = "VALUE UNDERFLOW"

Definition at line 27 of file constants.py.

◆ TYPE_UNKNOWN

str src.lib.actions.constants.TYPE_UNKNOWN = "UNKNOWN LOGGING TYPE"

Definition at line 13 of file constants.py.