azion
Version:
Azion Packages for Edge Computing.
1 lines • 111 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("mathjs"),L=require("ajv"),x=require("ajv-errors"),A=require("ajv-keywords"),S=["args","device_group","domain","geoip_city","geoip_city_continent_code","geoip_city_country_code","geoip_city_country_name","geoip_continent_code","geoip_country_code","geoip_country_name","geoip_region","geoip_region_name","host","remote_addr","remote_port","remote_user","request","request_body","request_method","request_uri","scheme","uri"],te=["server_addr","server_port"],re=["ssl_client_fingerprint","ssl_client_escaped_cert","ssl_client_s_dn","ssl_client_s_dn_parsed","ssl_client_cert","ssl_client_i_dn","ssl_client_serial","ssl_client_v_end","ssl_client_v_remain","ssl_client_v_start","ssl_client_verify"],ae=["sent_http_name","status","tcpinfo_rtt","upstream_addr","upstream_status"],ie=["cookie_time_offset","encode_base64"],C=[...S,...te,...re],E=[...S,...ae],c=["is_equal","is_not_equal","starts_with","does_not_start_with","matches","does_not_match"],m=["exists","does_not_exist"],_=["if","and","or"],se=[...new Set([...C,...E])],oe=["deny","drop","set_rate_limit","set_waf_ruleset","run_function","set_custom_response"],T=["second","minute"],v=["clientIp","global"],h=["learning","blocking"],u=["header_accept","header_accept_encoding","header_accept_language","header_cookie","header_origin","header_referer","header_user_agent","host","network","request_args","request_method","request_uri","scheme","client_certificate_validation","ssl_verification_status"],q=["if","and","or"],k=["ip_cidr","asn","countries"],ne=["2021-Q3"],M=["is_equal","is_not_equal","starts_with","does_not_start_with","matches","does_not_match","exists","does_not_exist","is_in_list","is_not_in_list"],le=["if","and","or"],de=["http,https","http"],pe=["","tls_1_0","tls_1_1","tls_1_2","tls_1_3"],ue=["all","TLSv1.2_2018","TLSv1.2_2019","TLSv1.2_2021","TLSv1.3_2022"],ce=[80,8008,8080],me=[443,8443,9440,9441,9442,9443],ge=["honor","override","no-cache"],he=["honor","override"],fe=["ignore","all","allowlist","denylist"],be=["ignore","all","allowlist","denylist"],ye=["ignore","allowlist"],_e=["options","post"],Te=["nearest-region","us-east-1","br-east-1"],ve=["webpack","esbuild"],Me=["read_only","read_write","restricted"],R=["deny","no_content","deliver","finish_request_phase","forward_cookies","optimize_images","bypass_cache","enable_gzip","redirect_http_to_https"],I=["redirect_to_301","redirect_to_302","rewrite_request"],O=["run_function","set_cache_policy","set_connector","set_origin"],N=["add_request_header","add_response_header","filter_request_header","filter_response_header"],$=["add_request_cookie","filter_request_cookie","set_cookie","filter_response_cookie"],B=["","tls_1_0","tls_1_1","tls_1_2","tls_1_3"],V=["enforce","permissive"],F=["http1","http2","http3"],D=["http","storage","live_ingest"],H=["both","force_ipv4"],W=["preserve","force_https","force_http"],z=["http1_1"],U=["round_robin","least_conn","ip_hash"],G=["aws4_hmac_sha256"],K=["default","400","401","403","404","405","406","408","409","410","411","414","415","416","426","429","431","500","501","502","503","504","505"],we=["page_connector"],qe={type:"object",properties:{name:{type:"string",minLength:1,maxLength:250,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 250 characters."},type:{type:"string",enum:k,errorMessage:"The 'type' field must be a string. Accepted values are 'asn', 'countries' or 'ip_cidr'."},items:{type:"array",minItems:1,maxItems:2e4,items:{type:"string",pattern:".*",errorMessage:"Each item in 'items' must be a string."},errorMessage:"The 'items' field must be an array of strings with 1-20000 items."},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean."}},required:["name","type","items"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in network list items.",required:"The 'name', 'type' and 'items' fields are required in each network list item."}},Pe={type:"object",properties:{name:{type:"string",minLength:1,maxLength:250,pattern:".*",errorMessage:"The 'name' field must be a string (1-250 characters)."},product_version:{type:["string","null"],minLength:3,maxLength:50,pattern:"\\d+\\.\\d+",default:"1.0",errorMessage:"The 'product_version' field must be a string matching pattern \\d+\\.\\d+ (e.g., '1.0')."},engine_settings:{type:"object",properties:{engine_version:{type:"string",enum:ne,default:"2021-Q3",errorMessage:"The 'engine_version' field must be '2021-Q3'."},type:{type:"string",enum:["score"],default:"score",errorMessage:"The 'type' field must be 'score'."},attributes:{type:"object",properties:{rulesets:{type:"array",items:{type:"integer",enum:[1]},default:[1],errorMessage:"The 'rulesets' field must be an array containing [1]."},thresholds:{type:"array",items:{type:"object",properties:{threat:{type:"string",enum:["cross_site_scripting","directory_traversal","evading_tricks","file_upload","identified_attack","remote_file_inclusion","sql_injection","unwanted_access"],errorMessage:"The 'threat' field must be a valid threat type."},sensitivity:{type:"string",enum:["highest","high","medium","low","lowest"],default:"medium",errorMessage:"The 'sensitivity' field must be one of: highest, high, medium, low, lowest."}},required:["threat","sensitivity"],additionalProperties:!1},maxItems:8,default:[{threat:"cross_site_scripting",sensitivity:"medium"},{threat:"directory_traversal",sensitivity:"medium"},{threat:"evading_tricks",sensitivity:"medium"},{threat:"file_upload",sensitivity:"medium"},{threat:"identified_attack",sensitivity:"medium"},{threat:"remote_file_inclusion",sensitivity:"medium"},{threat:"sql_injection",sensitivity:"medium"},{threat:"unwanted_access",sensitivity:"medium"}],errorMessage:"The 'thresholds' field must be an array of threat configurations (max 8 items)."}},required:["rulesets","thresholds"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in the attributes object.",required:"The 'rulesets' and 'thresholds' fields are required in the attributes object."}}},required:["engine_version","type","attributes"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in the engine_settings object.",required:"The 'engine_version', 'type', and 'attributes' fields are required in the engine_settings object."}}},required:["name","engine_settings"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in waf items.",required:"The 'name, mode, active, sql_injection, sql_injection_sensitivity, remote_file_inclusion, remote_file_inclusion_sensitivity, directory_traversal, directory_traversal_sensitivity, cross_site_scripting, cross_site_scripting_sensitivity, evading_tricks, evading_tricks_sensitivity, file_upload, file_upload_sensitivity, unwanted_access, unwanted_access_sensitivity, identified_attack, identified_attack_sensitivity and bypass_addresses' fields are required in each waf item."}},je={type:"object",properties:{variable:{type:"string",enum:u,errorMessage:"The 'variable' field must be a valid firewall variable."},operator:{type:"string",enum:M,errorMessage:"The 'operator' field must be a valid operator."},conditional:{type:"string",enum:le,errorMessage:"The 'conditional' field must be one of: if, and, or"},argument:{type:"string",errorMessage:"The 'argument' field must be a string."}},required:["variable","operator","conditional"],additionalProperties:!1,errorMessage:{required:"The 'variable', 'operator' and 'conditional' fields are required in criteria.",additionalProperties:"No additional properties are allowed in criteria."}},Le={type:"object",properties:{name:{type:"string",minLength:6,maxLength:63,pattern:"^.{6,63}$",errorMessage:"The 'name' field must be a string between 6 and 63 characters."},dir:{type:"string",errorMessage:"The 'dir' field must be a string."},workloads_access:{type:"string",enum:["read_only","read_write","restricted"],errorMessage:"The 'workloads_access' field must be one of: read_only, read_write, restricted."},prefix:{type:"string",errorMessage:"The 'prefix' field must be a string."}},required:["name","dir","prefix"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in storage items.",required:"The 'name', 'dir' and 'prefix' fields are required."}},xe={type:"object",properties:{name:{type:"string",minLength:6,maxLength:63,pattern:"^.{6,63}$",errorMessage:"The 'name' field must be a string between 6 and 63 characters."}},required:["name"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in kv items.",required:"The 'name' field is required."}},y={set_rate_limit:{type:"object",properties:{type:{type:"string",enum:T,errorMessage:"The rate limit 'type' must be either 'second' or 'minute'."},limit_by:{type:"string",enum:v,errorMessage:"The 'limit_by' field must be either 'client_ip' or 'global'."},average_rate_limit:{type:"string",pattern:"^[0-9]+$",errorMessage:"The 'average_rate_limit' must be a string containing a number."},maximum_burst_size:{type:"string",pattern:"^[0-9]+$",errorMessage:"The 'maximum_burst_size' must be a string containing a number."}},required:["type","limit_by","average_rate_limit"],additionalProperties:!1},set_waf_ruleset:{type:"object",properties:{waf_id:{type:"integer",errorMessage:"The waf_id must be an integer"},mode:{type:"string",enum:h,errorMessage:`The mode must be one of: ${h.join(", ")}`}},required:["waf_id","mode"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in the set_waf_ruleset object",required:"Both 'waf_id' and 'mode' fields are required in set_waf_ruleset"}},set_custom_response:{type:"object",properties:{status_code:{oneOf:[{type:"integer",minimum:200,maximum:499,errorMessage:"The status_code must be an integer between 200 and 499"},{type:"string",pattern:"^[2-4][0-9]{2}$",errorMessage:"The status_code as string must be a valid HTTP status code (200-499)"}],errorMessage:"The status_code must be either an integer or string between 200 and 499"},content_body:{type:"string",maxLength:500,errorMessage:"The content_body must be a string with maximum 500 characters"},content_type:{type:"string",errorMessage:"The content_type must be a string"}},required:["status_code","content_body","content_type"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in the set_custom_response object",required:"All fields ('status_code', 'content_body', 'content_type') are required in set_custom_response"}}},Ae={type:"object",properties:{name:{type:"string",enum:oe,errorMessage:"The behavior 'name' must be a valid firewall behavior."},target:{oneOf:[{type:"null"},{type:"string"},y.set_rate_limit,y.set_waf_ruleset,y.set_custom_response],errorMessage:"The 'target' must be a string, object, or null depending on the behavior."}},required:["name"],additionalProperties:!1,errorMessage:{required:"The 'name' field is required in firewall behaviors.",additionalProperties:"No additional properties are allowed in firewall behaviors."}},Se={type:"object",properties:{id:{type:"integer",errorMessage:"The 'id' field must be an integer."},name:{type:"string",errorMessage:"The 'name' field must be a string."},criteria:{type:"array",items:{type:"array",items:je,errorMessage:"The 'criteria' field must be an array of criteria objects."},errorMessage:"The 'criteria' field must be an array of criteria objects."},behaviors:{type:"array",items:Ae,errorMessage:"The 'behaviors' field must be an array of behavior objects."},description:{type:"string",maxLength:1e3,pattern:"^[\\u0000-\\uFFFF]*$",errorMessage:"The 'description' must not exceed 1000 characters and must not contain 4-byte unicode characters."},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean."}},required:["name","criteria","behaviors"],additionalProperties:!1,errorMessage:{type:"The 'firewall' field must be an object",required:"The 'name', 'criteria' and 'behaviors' fields are required in firewall rules.",additionalProperties:"No additional properties are allowed in firewall rules."}},Ce={type:"object",properties:{name:{type:"string",minLength:1,maxLength:250,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 250 characters"},runtime:{type:"string",enum:["azion_js"],default:"azion_js",errorMessage:"The 'runtime' field must be 'azion_js'"},code:{type:"string",minLength:1,maxLength:20971520,pattern:".*",errorMessage:"The 'code' field must be a string between 1 and 20971520 characters (20MB max)"},default_args:{type:"object",default:{},errorMessage:"The 'default_args' field must be an object"},execution_environment:{type:"string",enum:["application","firewall"],default:"application",errorMessage:"The 'execution_environment' field must be 'application' or 'firewall'"},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean"},path:{type:"string",errorMessage:"The 'path' field must be a string"},bindings:{type:"object",properties:{storage:{type:"object",properties:{bucket:{type:"string",errorMessage:"The 'bucket' field must be a string"},prefix:{type:"string",errorMessage:"The 'prefix' field must be a string"}},additionalProperties:!1}},additionalProperties:!1,errorMessage:"The 'bindings' field must be an object"}},required:["name"],additionalProperties:!1},Ee={type:["object","null"],properties:{main_settings:{type:"object",properties:{name:{type:"string",errorMessage:"The 'name' field must be a string."},domains:{type:"array",items:{type:"string",errorMessage:"Each domain in the firewall's domains list must be a string"}},is_active:{type:"boolean",errorMessage:"The 'is_active' field must be a boolean."},functions_enabled:{type:"boolean",errorMessage:"The 'functions_enabled' field must be a boolean."},network_protection_enabled:{type:"boolean",errorMessage:"The 'network_protection_enabled' field must be a boolean."},waf_enabled:{type:"boolean",errorMessage:"The 'waf_enabled' field must be a boolean."},debug_rules:{type:"boolean",errorMessage:"The 'debug_rules' field must be a boolean."}},required:["name"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in firewall main settings.",required:"The 'name' field is required in firewall main settings."}},rules_engine:{type:"array",items:Se,errorMessage:{type:"The 'rules_engine' field must be an array",required:"The 'rules_engine' field must be an array of firewall rules.",additionalProperties:"No additional properties are allowed in firewall rules."}}},required:["main_settings"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in firewall object.",required:"The 'main_settings' field is required in firewall object."}},ke={type:"object",properties:{name:{type:"string",minLength:1,maxLength:250,pattern:"^[a-zA-Z0-9 \\-.',|]+$",errorMessage:"The 'name' field must be a string between 1-250 characters with valid pattern."},browser_cache:{type:"object",properties:{behavior:{type:"string",enum:ge,default:"honor",errorMessage:"The 'behavior' must be one of: honor, override, no-cache."},max_age:{type:"integer",minimum:0,maximum:31536e3,default:0,errorMessage:"The 'max_age' must be between 0 and 31536000 seconds."}},required:["behavior","max_age"],additionalProperties:!1,errorMessage:{required:"Both 'behavior' and 'max_age' are required in browser_cache.",additionalProperties:"No additional properties are allowed in browser_cache."}},modules:{type:"object",properties:{cache:{type:"object",properties:{behavior:{type:"string",enum:he,default:"honor",errorMessage:"The 'behavior' must be either 'honor' or 'override'."},max_age:{type:"integer",minimum:0,maximum:31536e3,default:60,errorMessage:"The 'max_age' must be between 0 and 31536000 seconds."},stale_cache:{type:"object",properties:{enabled:{type:"boolean",errorMessage:"The 'enabled' field must be a boolean."}},required:["enabled"],additionalProperties:!1},large_file_cache:{type:"object",properties:{enabled:{type:"boolean",errorMessage:"The 'enabled' field must be a boolean."},offset:{type:"integer",minimum:0,errorMessage:"The 'offset' must be a non-negative integer."}},required:["enabled","offset"],additionalProperties:!1},tiered_cache:{type:["object","null"],properties:{enabled:{type:"boolean",errorMessage:"The 'enabled' field must be a boolean."},topology:{type:["string","null"],enum:[...Te,null],errorMessage:"The 'topology' must be one of: nearest-region, us-east-1, br-east-1 or null."}},required:["enabled"],if:{properties:{enabled:{const:!0}}},then:{required:["enabled","topology"],errorMessage:{required:"When 'enabled' is true, 'topology' is required in the 'tiered_cache' object."}},additionalProperties:!1}},required:["behavior","max_age"],additionalProperties:!1},application_accelerator:{type:"object",properties:{cache_vary_by_method:{type:"array",items:{type:"string",enum:_e},maxItems:2,errorMessage:"The 'cache_vary_by_method' must be an array of max 2 valid HTTP methods (options, post)."},cache_vary_by_querystring:{type:"object",properties:{behavior:{type:"string",enum:fe,default:"ignore",errorMessage:"The 'behavior' must be one of: ignore, all, allowlist, denylist."},fields:{type:"array",items:{type:"string"},errorMessage:"The 'fields' must be an array of strings."},sort_enabled:{type:"boolean",default:!0,errorMessage:"The 'sort_enabled' field must be a boolean."}},required:["behavior","fields","sort_enabled"],additionalProperties:!1},cache_vary_by_cookies:{type:"object",properties:{behavior:{type:"string",enum:be,default:"ignore",errorMessage:"The 'behavior' must be one of: ignore, all, allowlist, denylist."},cookie_names:{type:"array",items:{type:"string"},errorMessage:"The 'cookie_names' must be an array of strings."}},required:["behavior","cookie_names"],additionalProperties:!1},cache_vary_by_devices:{type:"object",properties:{behavior:{type:"string",enum:ye,default:"ignore",errorMessage:"The 'behavior' must be either 'ignore' or 'allowlist'."},device_group:{type:"array",items:{type:"integer"},errorMessage:"The 'device_group' must be an array of integers."}},required:["behavior","device_group"],additionalProperties:!1}},required:["cache_vary_by_method","cache_vary_by_querystring","cache_vary_by_cookies","cache_vary_by_devices"],additionalProperties:!1}},required:["cache","application_accelerator"],additionalProperties:!1}},required:["name","browser_cache","modules"],additionalProperties:!1},Re={oneOf:[{type:"object",properties:{type:{type:"string",enum:R}},required:["type"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",enum:I},attributes:{type:"object",properties:{value:{type:"string",minLength:1,maxLength:255}},required:["value"],additionalProperties:!1}},required:["type","attributes"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",enum:O},attributes:{type:"object",properties:{value:{oneOf:[{type:"string",minLength:1,maxLength:255},{type:"integer",minimum:1}]}},required:["value"],additionalProperties:!1}},required:["type","attributes"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",enum:N},attributes:{type:"object",properties:{value:{type:"string",minLength:1,maxLength:255,pattern:".*"}},required:["value"],additionalProperties:!1}},required:["type","attributes"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",enum:$},attributes:{type:"object",properties:{value:{type:"string",minLength:1,maxLength:255,pattern:".*"}},required:["value"],additionalProperties:!1}},required:["type","attributes"],additionalProperties:!1},{type:"object",properties:{type:{type:"string",enum:["capture_match_groups"]},attributes:{type:"object",properties:{regex:{type:"string",minLength:1,maxLength:255},subject:{type:"string",minLength:4,maxLength:50},captured_array:{type:"string",minLength:1,maxLength:10}},required:["regex","subject","captured_array"],additionalProperties:!1}},required:["type","attributes"],additionalProperties:!1}]},Ie={type:"object",properties:{variable:{type:"string",pattern:`^\\$\\{(${Array.from(new Set(se)).join("|")})\\}$`,errorMessage:"The 'variable' field must be a valid variable name wrapped in ${}."},operator:{type:"string",enum:[...c,...m],errorMessage:"The 'operator' field must be a valid operator."},conditional:{type:"string",enum:_,errorMessage:"The 'conditional' field must be one of: if, and, or."},argument:{type:"string",errorMessage:"The 'argument' field must be a string."}},required:["variable","operator","conditional"],allOf:[{if:{properties:{operator:{enum:c}}},then:{required:["argument"]}},{if:{properties:{operator:{enum:m}}},then:{not:{required:["argument"]}}}],additionalProperties:!1},Oe={type:"object",properties:{phase:{type:"string",enum:["request","response"],errorMessage:"The 'phase' field must be either 'request' or 'response'."},rule:{type:"object",properties:{name:{type:"string",minLength:1,maxLength:250,errorMessage:"The 'name' field must be a string between 1 and 250 characters."},description:{type:"string",maxLength:1e3,errorMessage:"The 'description' field must be a string with maximum 1000 characters."},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean."},criteria:{type:"array",items:{type:"array",items:Ie,minItems:1,maxItems:10},minItems:1,maxItems:5,errorMessage:"The criteria must be an array of arrays with 1-5 groups."},behaviors:{type:"array",items:Re,minItems:1,maxItems:10,errorMessage:"The behaviors must be an array with 1-10 items."}},required:["name","criteria","behaviors"],additionalProperties:!1}},required:["phase","rule"],additionalProperties:!1},Ne=Oe,$e={type:"object",properties:{name:{type:"string",minLength:1,maxLength:100,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 100 characters."},delivery_protocol:{type:"string",enum:de,default:"http",errorMessage:"The 'delivery_protocol' field must be either 'http,https' or 'http'."},http3:{type:"boolean",errorMessage:"The 'http3' field must be a boolean."},http_port:{type:"array",items:{type:"integer",enum:ce},errorMessage:{enum:"The 'http_port' field must be an array of valid HTTP ports.",type:"The 'http_port' field must be an array"}},https_port:{type:"array",items:{type:"integer",enum:me},default:[443],errorMessage:"The 'https_port' field must be an array of valid HTTPS ports."},minimum_tls_version:{type:"string",enum:pe,default:"",errorMessage:"The 'minimum_tls_version' field must be a valid TLS version."},supported_ciphers:{type:"string",enum:ue,default:"all",errorMessage:"The 'supported_ciphers' field must be a valid cipher suite."},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean."},debug:{type:"boolean",default:!1,errorMessage:"The 'debug' field must be a boolean."},modules:{type:"object",properties:{cache:{type:"object",properties:{enabled:{type:"boolean",default:!0,errorMessage:"The 'enabled' field must be a boolean."}},required:["enabled"],additionalProperties:!1},functions:{type:"object",properties:{enabled:{type:"boolean",default:!1,errorMessage:"The 'enabled' field must be a boolean."}},required:["enabled"],additionalProperties:!1},application_accelerator:{type:"object",properties:{enabled:{type:"boolean",default:!1,errorMessage:"The 'enabled' field must be a boolean."}},required:["enabled"],additionalProperties:!1},image_processor:{type:"object",properties:{enabled:{type:"boolean",default:!1,errorMessage:"The 'enabled' field must be a boolean."}},required:["enabled"],additionalProperties:!1}},required:[],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in modules object."}},cache_settings:{type:"array",items:ke,errorMessage:"The 'cache_settings' field must be an array of cache setting items."},rules:{type:"array",items:Ne,errorMessage:"The 'rules' field must be an array of application rule items."},device_groups:{type:"array",items:{type:"object",properties:{name:{type:"string",minLength:1,maxLength:250,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 250 characters."},user_agent:{type:"string",minLength:1,maxLength:512,pattern:".*",errorMessage:"The 'user_agent' field must be a valid regex pattern between 1 and 512 characters."}},required:["name","user_agent"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in device group objects.",required:"The 'name' and 'user_agent' fields are required in each device group."}},errorMessage:"The 'device_groups' field must be an array of device group objects."},functions_instances:{type:"array",items:{type:"object",properties:{name:{type:"string",minLength:1,maxLength:100,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 100 characters."},function:{oneOf:[{type:"string",minLength:1,maxLength:250,errorMessage:"The 'function' field must be a string between 1 and 250 characters."},{type:"integer",minimum:1,errorMessage:"The 'function' field must be an integer >= 1."}],errorMessage:"The 'function' field must be either a string (function name) or integer (function ID)."},args:{type:"object",default:{},errorMessage:"The 'args' field must be an object."},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean."}},required:["name","function"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in function instance objects.",required:"The 'name' and 'function' fields are required in each function instance."}},errorMessage:"The 'functions_instances' field must be an array of function instance objects."}},required:["name"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in application items.",required:"The 'name field are required."}},Be={type:"object",properties:{name:{type:"string",minLength:1,maxLength:100,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 100 characters"},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean"},infrastructure:{type:"integer",enum:[1,2],default:1,errorMessage:"The 'infrastructure' must be either 1 or 2"},workload_domain_allow_access:{type:"boolean",default:!0,errorMessage:"The 'workload_domain_allow_access' field must be a boolean"},domains:{type:"array",items:{type:"string",minLength:1,maxLength:250,errorMessage:"Each domain must be a string between 1 and 250 characters"},errorMessage:"The 'domains' field must be an array of domain strings"},tls:{type:"object",properties:{certificate:{type:["integer","null"],minimum:1,errorMessage:"The 'certificate' must be an integer >= 1 or null"},ciphers:{type:["integer","null"],enum:[1,2,3,4,5,6,7,8,null],errorMessage:"The 'ciphers' must be an integer between 1-8 or null"},minimum_version:{type:["string","null"],enum:[...B,null],default:"tls_1_3",errorMessage:"The 'minimum_version' must be a valid TLS version or null"}},default:{certificate:null,ciphers:null,minimum_version:"tls_1_3"},additionalProperties:!1},protocols:{type:"object",properties:{http:{type:"object",properties:{versions:{type:"array",items:{type:"string",enum:F},default:["http1","http2"]},http_ports:{type:"array",items:{type:"integer"},default:[80]},https_ports:{type:"array",items:{type:"integer"},default:[443]},quic_ports:{type:["array","null"],items:{type:"integer"}}},required:["versions","http_ports","https_ports"],additionalProperties:!1}},default:{http:{versions:["http1","http2"],http_ports:[80],https_ports:[443],quic_ports:null}},additionalProperties:!1},mtls:{type:"object",properties:{enabled:{type:"boolean",default:!1},config:{type:"object",properties:{verification:{type:"string",enum:V,default:"enforce"},certificate:{type:["integer","null"],minimum:1},crl:{type:["array","null"],items:{type:"integer"},maxItems:100}},additionalProperties:!1}},additionalProperties:!1}},required:["name","domains"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in workload items",required:"The 'name' and 'domains' fields are required in workload items"}},Ve={type:["object","null"],properties:{name:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 255 characters"},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean"},type:{type:"string",enum:D,errorMessage:"The 'type' must be one of: http, storage, live_ingest"},attributes:{oneOf:[{type:"object",properties:{bucket:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'bucket' field must be a string between 1 and 255 characters"},prefix:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'prefix' field must be a string between 1 and 255 characters"}},required:["bucket"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in storage attributes.",required:"The 'bucket' field is required in storage attributes."}},{type:"object",properties:{addresses:{type:"array",minItems:1,items:{type:"object",properties:{active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean"},address:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'address' field must be a string between 1 and 255 characters"},http_port:{type:"integer",minimum:1,maximum:65535,default:80,errorMessage:"The 'http_port' must be between 1 and 65535"},https_port:{type:"integer",minimum:1,maximum:65535,default:443,errorMessage:"The 'https_port' must be between 1 and 65535"},modules:{type:["object","null"],errorMessage:"The 'modules' field must be an object or null"}},required:["address"],additionalProperties:!1},errorMessage:"The 'addresses' field must be an array of address objects"},connection_options:{type:"object",properties:{dns_resolution:{type:"string",enum:H,default:"preserve",errorMessage:"The 'dns_resolution' must be one of: both, force_ipv4"},transport_policy:{type:"string",enum:W,default:"preserve",errorMessage:"The 'transport_policy' must be one of: preserve, force_https, force_http"},http_version_policy:{type:"string",enum:z,default:"http1_1",errorMessage:"The 'http_version_policy' must be http1_1"},host:{type:"string",minLength:1,maxLength:255,pattern:".*",default:"${host}",errorMessage:"The 'host' field must be a string between 1 and 255 characters"},path_prefix:{type:"string",minLength:0,maxLength:255,pattern:".*",default:"",errorMessage:"The 'path_prefix' field must be a string between 0 and 255 characters"},following_redirect:{type:"boolean",default:!1,errorMessage:"The 'following_redirect' field must be a boolean"},real_ip_header:{type:"string",minLength:1,maxLength:255,pattern:".*",default:"X-Real-IP",errorMessage:"The 'real_ip_header' field must be a string between 1 and 255 characters"},real_port_header:{type:"string",minLength:1,maxLength:255,pattern:".*",default:"X-Real-PORT",errorMessage:"The 'real_port_header' field must be a string between 1 and 255 characters"}},required:["dns_resolution","transport_policy","http_version_policy","host","path_prefix","following_redirect","real_ip_header","real_port_header"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in connection options.",required:"All connection options fields are required."}},modules:{type:"object",properties:{load_balancer:{type:"object",properties:{enabled:{type:"boolean",errorMessage:"The 'enabled' field must be a boolean"},config:{type:["object","null"],properties:{method:{type:"string",enum:U,errorMessage:"The 'method' must be one of: round_robin, least_conn, ip_hash"},max_retries:{type:"integer",minimum:0,maximum:10,errorMessage:"The 'max_retries' must be between 0 and 10"},connection_timeout:{type:"integer",minimum:1,maximum:300,errorMessage:"The 'connection_timeout' must be between 1 and 300"},read_write_timeout:{type:"integer",minimum:1,maximum:300,errorMessage:"The 'read_write_timeout' must be between 1 and 300"}},additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in load balancer config."}}},required:["enabled"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in load balancer.",required:"The 'enabled' field is required in load balancer."}},origin_shield:{type:"object",properties:{enabled:{type:"boolean",errorMessage:"The 'enabled' field must be a boolean"},config:{type:["object","null"],properties:{origin_ip_acl:{type:"object",properties:{enabled:{type:"boolean",errorMessage:"The 'enabled' field must be a boolean"}},additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in origin IP ACL."}},hmac:{type:"object",properties:{enabled:{type:"boolean",errorMessage:"The 'enabled' field must be a boolean"},config:{type:["object","null"],properties:{type:{type:"string",enum:G,errorMessage:"The 'type' must be aws4_hmac_sha256"},attributes:{type:"object",properties:{region:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'region' field must be a string between 1 and 255 characters"},service:{type:"string",minLength:1,maxLength:255,pattern:".*",default:"s3",errorMessage:"The 'service' field must be a string between 1 and 255 characters"},access_key:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'access_key' field must be a string between 1 and 255 characters"},secret_key:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'secret_key' field must be a string between 1 and 255 characters"}},required:["region","access_key","secret_key"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in HMAC attributes.",required:"The 'region', 'access_key', and 'secret_key' fields are required in HMAC attributes."}}},additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in HMAC config."}}},required:["enabled"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in HMAC.",required:"The 'enabled' field is required in HMAC."}}},additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in origin shield config."}}},required:["enabled"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in origin shield.",required:"The 'enabled' field is required in origin shield."}}},required:["load_balancer","origin_shield"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in modules.",required:"The 'load_balancer' and 'origin_shield' fields are required in modules."}}},required:["addresses","connection_options","modules"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in HTTP/Live Ingest attributes.",required:"The 'addresses', 'connection_options', and 'modules' fields are required in HTTP/Live Ingest attributes."}}],errorMessage:"The 'attributes' field must match either storage format (bucket, prefix) or HTTP/Live Ingest format (addresses, connection_options, modules)."}},required:["name","type","attributes"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in connector items.",required:"The 'name', 'type' and 'attributes' fields are required in each connector item."}},Y={type:"object",properties:{networkList:{type:"array",items:qe,errorMessage:"The 'networkList' field must be an array of network list items."},waf:{type:"array",items:Pe,errorMessage:{type:"The 'waf' field must be an array"}},firewall:{type:"array",items:Ee,errorMessage:{type:"The 'firewall' field must be an array of firewall objects"}},applications:{type:"array",items:$e,minItems:1,errorMessage:"The 'applications' field must be an array of application items with at least one item."},workloads:{type:"array",items:Be,errorMessage:"The 'workload' field must be an array of workloads items."},workload_deployments:{type:"array",items:{type:"object",properties:{name:{type:"string",minLength:1,maxLength:254,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 254 characters."},current:{type:"boolean",default:!0,errorMessage:"The 'current' field must be a boolean."},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean."},strategy:{type:"object",properties:{type:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'type' field must be a string between 1 and 255 characters."},attributes:{type:"object",properties:{application:{type:"string",errorMessage:"The 'application' field must be a string."},firewall:{type:["string","null"],errorMessage:"The 'firewall' field must be a string or null."},custom_page:{type:["string","null"],errorMessage:"The 'custom_page' field must be a string or null."}},required:["application"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in strategy attributes.",required:"The 'application' field is required in strategy attributes."}}},required:["type","attributes"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in strategy.",required:"The 'type' and 'attributes' fields are required in strategy."}}},required:["name","strategy"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in workload deployment objects.",required:"The 'name' and 'strategy' fields are required in each workload deployment."}},minItems:1,errorMessage:"The 'workload_deployments' field must be an array of workload deployment objects with at least one item."},connectors:{type:"array",items:Ve,errorMessage:{type:"The 'connectors' field must be an array"}},custom_pages:{type:"array",items:{type:"object",properties:{name:{type:"string",minLength:1,maxLength:255,pattern:".*",errorMessage:"The 'name' field must be a string between 1 and 255 characters."},active:{type:"boolean",default:!0,errorMessage:"The 'active' field must be a boolean."},pages:{type:"array",minItems:1,items:{type:"object",properties:{code:{type:"string",enum:K,errorMessage:"The 'code' field must be a valid error code."},page:{type:"object",properties:{type:{type:"string",minLength:1,maxLength:255,default:"page_connector",pattern:".*",errorMessage:"The 'type' field must be a string between 1 and 255 characters."},attributes:{type:"object",properties:{connector:{type:"string",errorMessage:"The 'connector' field must be a string."},ttl:{type:"integer",minimum:0,maximum:31536e3,default:0,errorMessage:"The 'ttl' field must be an integer between 0 and 31536000."},uri:{type:["string","null"],minLength:1,maxLength:250,pattern:"^/[/a-zA-Z0-9\\-_.~@:]*$",errorMessage:"The 'uri' field must be a valid URI path starting with / or null."},custom_status_code:{type:["integer","null"],minimum:100,maximum:599,errorMessage:"The 'custom_status_code' field must be an integer between 100 and 599 or null."}},required:["connector"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in page attributes.",required:"The 'connector' field is required in page attributes."}}},required:["type","attributes"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in page configuration.",required:"The 'type' and 'attributes' fields are required in page configuration."}}},required:["code","page"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in page entry.",required:"The 'code' and 'page' fields are required in each page entry."}},errorMessage:"The 'pages' field must be an array of page configurations with at least one item."}},required:["name","pages"],additionalProperties:!1,errorMessage:{additionalProperties:"No additional properties are allowed in custom page objects.",required:"The 'name' and 'pages' fields are required in each custom page."}},errorMessage:"The 'custom_pages' field must be an array of custom page objects."},functions:{type:"array",items:Ce,errorMessage:"The 'functions' field must be an array of function items."},storage:{type:"array",items:Le,errorMessage:"The 'storage' field must be an array of storage items."},kv:{type:"array",items:xe,errorMessage:"The 'kv' field must be an array of kv items."}},required:["build","applications","workloads","workload_deployments"],errorMessage:{required:"The 'build', 'applications', 'workloads', and 'workload_deployments' fields are required in the manifest."}};class d{transformToManifest(a,t){return t}transformToConfig(a,t){return a}}const Fe=w.create(w.all);class De extends d{evaluateMathExpression=a=>{if(typeof a=="number")return a;if(/^[0-9+\-*/.() ]+$/.test(a))return Fe.evaluate(a);throw new Error(`Expression is not purely mathematical: ${a}`)};transformToManifest(a){return!Array.isArray(a)||a.length===0?[]:a.map(t=>{const e=t?.browser?this.evaluateMathExpression(t.browser.maxAgeSeconds):0,r=t?.edge?this.evaluateMathExpression(t.edge.maxAgeSeconds):60,i=[];t?.methods?.post&&i.push("post"),t?.methods?.options&&i.push("options");const o={behavior:t?.cacheByQueryString?.option||"ignore",fields:t?.cacheByQueryString?.list||[],sort_enabled:t?.queryStringSort||!1},n={behavior:t?.cacheByCookie?.option||"ignore",cookie_names:t?.cacheByCookie?.list||[]},l={name:t.name,browser_cache:{behavior:t?.browser?"override":"honor",max_age:e},modules:{cache:{behavior:t?.edge?"override":"honor",max_age:r,stale_cache:{enabled:t?.stale||!1},large_file_cache:{enabled:!1,offset:1024},tiered_cache:{enabled:t?.tieredCache?.enabled||!1}},application_accelerator:{cache_vary_by_method:i,cache_vary_by_querystring:o,cache_vary_by_cookies:n,cache_vary_by_devices:{behavior:"ignore",device_group:[]}}}};return t?.tieredCache?.enabled===!0&&(l.modules.cache.tiered_cache.topology=t.tieredCache.topology),l})}transformToConfig(a){return!Array.isArray(a)||a.length===0?[]:a.map(t=>{const e=t.browser_cache?.max_age?this.evaluateMathExpression(t.browser_cache.max_age):0,r=t.modules?.cache?.max_age?this.evaluateMathExpression(t.modules.cache.max_age):60,i={name:t.name,stale:t.modules?.cache?.stale_cache?.enabled||!1,browser:{maxAgeSeconds:e},edge:{maxAgeSeconds:r},methods:{post:t.modules?.application_accelerator?.cache_vary_by_method?.includes("post")||!1,options:t.modules?.application_accelerator?.cache_vary_by_method?.includes("options")||!1},queryStringSort:t.modules?.application_accelerator?.cache_vary_by_querystring?.sort_enabled||!1,tieredCache:{enabled:t.modules?.cache?.tiered_cache?.enabled||!1}};if(i.tieredCache&&i.tieredCache.enabled===!0&&(i.tieredCache.topology=t.modules?.cache?.tiered_cache?.topology),t.modules?.application_accelerator?.cache_vary_by_querystring){const o=t.modules.application_accelerator.cache_vary_by_querystring;i.cacheByQueryString={option:o.behavior,list:o.fields||[]}}if(t.modules?.application_accelerator?.cache_vary_by_cookies){const o=t.modules.application_accelerator.cache_vary_by_cookies;i.cacheByCookie={option:o.behavior,list:o.cookie_names||[]}}return i})}}class He extends d{transformToManifest(a){if(!(!Array.isArray(a)||a.length===0))return a.map(t=>({name:t.name,user_agent:t.userAgent}))}transformToConfig(a){return!Array.isArray(a)||a.length===0?[]:a.map(t=>({name:t.name,userAgent:t.user_agent}))}}class We extends d{validateEdgeFunctionReference(a,t,e){if(typeof t=="string"&&(!Array.isArray(a)||!a.find(r=>r.name===t)))throw new Error(`Function instance "${e}" references non-existent Function "${t}".`)}transformToManifest(a,t){if(!(!Array.isArray(a)||a.length===0))return a.map(e=>(this.validateEdgeFunctionReference(t.functions,e.ref,e.name),{name:e.name,function:e.ref,args:e.args||{},active:e.active??!0}))}transformToConfig(a){return!Array.isArray(a)||a.length===0?[]:a.map(t=>({name:t.name,ref:t.function,args:t.args,active:t.active??!0}))}}class ze extends d{validateFunctionReferences(a,t){if(!t)return;const e=new Set(t.map(r=>r.name));if(a.request){for(const r of a.request)for(const i of r.behaviors)if(i.type==="run_function"&&i.attributes&&typeof i.attributes.value=="string"&&!e.has(i.attributes.value))throw new Error(`Function "${i.attributes.value}" referenced in rule "${r.name}" is not defined in the functions array.`)}if(a.response){for(const r of a.response)for(const i of r.behaviors)if(i.type==="run_function"&&i.attributes&&typeof i.attributes.value=="string"&&!e.has(i.attributes.value))throw new Error(`Function "${i.attributes.value}" referenced in rule "${r.name}" is not defined in the functions array.`)}}validateConnectorReferences(a,t){if(!t)return;const e=new Set(t.map(r=>r.name));if(a.request){for(const r of a.request)for(const i of r.behaviors)if(i.type==="set_connector"&&i.attributes&&typeof i.attributes.value=="string"&&!e.has(i.attributes.value))throw new Error(`Connector "${i.attributes.value}" referenced in rule "${r.name}" is not defined in the connectors array.`)}if(a.response){for(const r of a.response)for(const i of r.behaviors)if(i.type==="set_connector"&&i.attributes&&typeof i.attributes.value=="string"&&!e.has(i.attributes.value))throw new Error(`Connector "${i.attributes.value}" referenced in rule "${r.name}" is not defined in the connectors array.`)}}transformToManifest(a,t,e){this.validateFunctionReferences(a,t),this.validateConnectorReferences(a,e);const r=[];return!a||Object.keys(a).length===0||(Array.isArray(a.request)&&a.request.forEach(i=>{const o={phase:"request",rule:{name:i.name,description:i.description,active:i.active!==void 0?i.active:!0,criteria:i.criteria.map(n=>n.map(l=>({variable:l.variable.startsWith("${")?l.variable:`\${${l.variable}}`,conditional:l.conditional,operator:l.operator,..."argument"in l&&{argument:l.argument}}))),behaviors:i.behaviors.map(n=>({type:n.type,..."attributes"in n&&n.attributes&&{attributes:n.attributes}}))}};r.push(o)}),Array.isArray(a.response)&&a.response.forEach(i=>{const o={phase:"response",rule:{name:i.name,description:i.description,active:i.active!==void 0?i.active:!0,criteria:i.criteria.map(n=>n.map(l=>({variable:l.variable.startsWith("${")?l.variable:`\${${l.variable}}`,conditional:l.conditional,operator:l.operator,..."argument"in l&&{argument:l.argument}}))),behaviors:i.behaviors.map(n=>({type:n.type,..."attributes"in n&&n.attributes&&{attributes:n.attributes}}))}};r.push(o)})),r}transformToConfig(a){if(!Array.isArray(a))return{request:[],response:[]};const t={request:[],response:[]};return a.forEach(e=>{const r={name:e.rule.name,description:e.rule.description,active:e.rule.active!==void 0?e.rule.active:!0,criteria:e.rule.criteria.map(i=>i.map(o=>{const n={variable:o.variable,conditional:o.conditional,operator:o.operator};return"argument"in o&&o.argument!==void 0?{...n,argument:o.argument}:n})),behaviors:e.rule.behaviors.map(i=>({type:i.type,..."attributes"in i&&i.attributes&&{attributes:i.attributes}}))};e.phase==="request"?t.request.push(r):e.phase==="response"&&t.response.push(r)}),t}}class Ue extends d{cacheStrategy=new De;rulesStrategy=new ze;deviceGroupsStrategy=new He;functionInstancesStrategy=new We;transformToManifest(a){return!a.applications||!Array.isArray(a.applications)?[]:a.applications.map(t=>{const e={name:t.name,active:t.active??!0,debug:t.debug??!1,modules:{cache:{enabled:t.edgeCacheEnabled??!0},functions:{enabled:!!(t.functionsEnabled||t.functionsInstances&&t.functionsInstances.length>0)},application_accelerator:{enabled:t.applicationAcceleratorEnabled??!0},image_processor:{enabled:t.imageProcessorEnabled??!1}}};return t.cache&&(e.cache_settings=this.cacheStrategy.transformToManifest(t.cache)),t.rules&&(e.rules=this.rulesStrategy.transformToManifest(t.rules,a.functions,a.connectors)),t.deviceGroups&&(e.device_groups=this.deviceGroupsStrategy.transformToManifest(t.deviceGroups)),t.functionsInstances&&(e.functions_instances=this.functionInstancesStrategy.transformToManifest(t.functionsInstances,a)),e})}transformToConfig(a,t){return!a.applications||!Array.isArray(a.applications)?(t.applications=[],t.applications):(t.applications=a.applications.map(e=>({name:e.name,active:e.active,debug:e.debug,edgeCacheEnabled:e.modules?.cache?.enabled,functionsEnabled:e.modules?.functions?.enabled,applicationAcceleratorEnabled:e.modules?.application_accelerator?.enabled,imageProcessorEnabled:e.modules?.image_processor?.enabled,cache:e.cache_settings?this.cacheStrategy.transformToConfig(e.cache_settings):void 0,rules:e.rules?this.rulesStrategy.transformToConfig(e.rules):void 0,deviceGroups:e.device_groups?this.deviceGroupsStrategy.transformToConfig(e.device_groups):void 0,functionsInstances:e.functions_instances?this.functionInstancesStrategy.transformToConfig(e.functions_instances):void 0})),t.applications)}}class Ge extends d{transformToManifest(a){const t=a?.build;return t||void 0}transformToConfig(a,t){const e=a?.build;return t.build=e,t.build}}class Ke extends d{transformToManifest(a){const t=a?.connectors;if(!(!t||t.length===0))return t.map(e=>{const r={name:e.name,active:e.active??!0,type:e.type};return e.type==="storage"?{...r,attributes:{bucket:e.attributes.bucket,prefix:e.attributes.prefix}}:{...r,attributes:{addresses:e.attributes.addresses.map(i=>({active:i.active??!0,address:i.address,http_port:i.httpPort??80,https_port:i.httpsPort??443,modules:i.modules||null})),connection_options:{dns_resolution:e.attributes.connectionOptions.dnsResolution??"both",transport_policy:e.attributes.connectionOptions.transportPolicy??"preserve",http_version_policy:e.attributes.connectionOptions.httpVersionPolicy??"http1_1",host:e.attributes.connectionOptions.host??"${host}",path_prefix:e.attributes.connectionOptions.pathPrefix??"",following_redirect:e.attributes.connectio