<commit_before>declaration template quattor/types/component;

include 'quattor/functions/validation';

type structure_component_dependency = {
    "pre"       ? string[] with is_component_list(SELF)
    "post"      ? string[] with is_component_list(SELF)
};

type structure_component_code = {
    "script"    : string
    "data"      ? string{}
};

type structure_component = extensible {
    "active"            : boolean = true # "component active?"
    "dispatch"          : boolean = true # "run with cdispd?"
    "version"           ? string with match(SELF, '^\d+\.\d+\.\d+$')
    "register_change"   ? element*[]
    "dependencies"      ? structure_component_dependency
    "code"              ? structure_component_code
    "ncm-module"        ? string with match(SELF, '^([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)$')
};<commit_msg>Deprecate shipping of component code in profiles<commit_after>declaration template quattor/types/component;

include 'quattor/functions/validation';

type structure_component_dependency = {
    "pre"       ? string[] with is_component_list(SELF)
    "post"      ? string[] with is_component_list(SELF)
};

type structure_component_code = {
    "script"    : string
    "data"      ? string{}
};

type structure_component = extensible {
    "active"            : boolean = true # "component active?"
    "dispatch"          : boolean = true # "run with cdispd?"
    "version"           ? string with match(SELF, '^\d+\.\d+\.\d+$')
    "register_change"   ? element*[]
    "dependencies"      ? structure_component_dependency
    "code"              ? structure_component_code with { deprecated(0, "The code property has been deprecated, support for shipping component code in profiles was removed in 15.2"); true; }
    "ncm-module"        ? string with match(SELF, '^([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)$')
};
{'fraction_non_alphanumeric': 0.14207947740881874, 'fraction_numerical': 0.002177463255307567, 'mean_word_length': 2.9783549783549783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '331034', 'n_tokens_mistral': 578, 'n_tokens_neox': 559, 'n_words': 128}