@redocly/revel 0.138.0-next.2 → 0.138.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/client/App.js +1 -1
- package/dist/client/TestProvider.d.ts +3 -1
- package/dist/client/TestProvider.js +1 -1
- package/dist/client/app/hooks/codeHighlight/useCodeHighlight.js +1 -1
- package/dist/client/app/hooks/index.d.ts +1 -0
- package/dist/client/app/hooks/index.js +1 -1
- package/dist/client/app/hooks/useConsent.d.ts +11 -0
- package/dist/client/app/hooks/useConsent.js +1 -0
- package/dist/client/app/webmcp/index.d.ts +2 -0
- package/dist/client/app/webmcp/index.js +1 -0
- package/dist/client/app/webmcp/tools/api-tools.d.ts +8 -0
- package/dist/client/app/webmcp/tools/api-tools.js +1 -0
- package/dist/client/app/webmcp/tools/shared.d.ts +13 -0
- package/dist/client/app/webmcp/tools/shared.js +1 -0
- package/dist/client/app/webmcp/tools/site-tools.d.ts +5 -0
- package/dist/client/app/webmcp/tools/site-tools.js +3 -0
- package/dist/client/app/webmcp/types.d.ts +36 -0
- package/dist/client/app/webmcp/types.js +0 -0
- package/dist/client/app/webmcp/useWebMcpTools.d.ts +9 -0
- package/dist/client/app/webmcp/useWebMcpTools.js +1 -0
- package/dist/client/providers/theme/ThemeDataProvider.js +1 -1
- package/dist/constants/common.d.ts +1 -0
- package/dist/constants/common.js +1 -1
- package/dist/constants/l10n/langs/ar.js +1 -1
- package/dist/constants/l10n/langs/de.js +1 -1
- package/dist/constants/l10n/langs/en.js +1 -1
- package/dist/constants/l10n/langs/es.js +1 -1
- package/dist/constants/l10n/langs/fr.js +1 -1
- package/dist/constants/l10n/langs/hi.js +1 -1
- package/dist/constants/l10n/langs/it.js +1 -1
- package/dist/constants/l10n/langs/ja.js +1 -1
- package/dist/constants/l10n/langs/ko.js +1 -1
- package/dist/constants/l10n/langs/pl.js +1 -1
- package/dist/constants/l10n/langs/pt-BR.js +1 -1
- package/dist/constants/l10n/langs/pt.js +1 -1
- package/dist/constants/l10n/langs/ru.js +1 -1
- package/dist/constants/l10n/langs/uk.js +1 -1
- package/dist/constants/l10n/langs/zh.js +1 -1
- package/dist/markdoc/nodes/table.d.ts +2 -0
- package/dist/markdoc/nodes/table.js +1 -1
- package/dist/server/constants/entitlements.js +1 -1
- package/dist/server/constants/plugins/consent.d.ts +3 -0
- package/dist/server/constants/plugins/consent.js +1 -0
- package/dist/server/plugins/analytics/adobe/index.js +1 -1
- package/dist/server/plugins/analytics/amplitude/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/amplitude/index.js +1 -1
- package/dist/server/plugins/analytics/fullstory/index.js +1 -1
- package/dist/server/plugins/analytics/ga/index.js +1 -1
- package/dist/server/plugins/analytics/gtm/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/gtm/index.js +1 -1
- package/dist/server/plugins/analytics/heap/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/rudderstack/index.js +1 -1
- package/dist/server/plugins/analytics/segment/index.js +1 -1
- package/dist/server/plugins/config-parser/format-custom-tags.d.ts +1 -0
- package/dist/server/plugins/config-parser/format-custom-tags.js +1 -1
- package/dist/server/plugins/config-parser/index.js +1 -1
- package/dist/server/plugins/config-parser/loaders/redocly-config-loader.js +1 -1
- package/dist/server/plugins/consent/build-consent-script.d.ts +6 -0
- package/dist/server/plugins/consent/build-consent-script.js +230 -0
- package/dist/server/plugins/consent/gate-ssr-components.d.ts +5 -0
- package/dist/server/plugins/consent/gate-ssr-components.js +1 -0
- package/dist/server/plugins/consent/index.d.ts +3 -0
- package/dist/server/plugins/consent/index.js +1 -0
- package/dist/server/plugins/consent/is-consent-enabled.d.ts +8 -0
- package/dist/server/plugins/consent/is-consent-enabled.js +1 -0
- package/dist/server/plugins/consent/zone-modes.d.ts +8 -0
- package/dist/server/plugins/consent/zone-modes.js +1 -0
- package/dist/server/plugins/lifecycle.js +2 -2
- package/dist/server/plugins/markdown/markdoc/markdoc-options.d.ts +2 -0
- package/dist/server/plugins/markdown/search/get-ai-search-documents.js +9 -9
- package/dist/server/plugins/markdown/search/nodes/tag-node.d.ts +1 -1
- package/dist/server/plugins/markdown/search/nodes/tag-node.js +1 -1
- package/dist/server/plugins/mcp/audit/audit-log.js +1 -1
- package/dist/server/utils/redact-url.d.ts +6 -0
- package/dist/server/utils/redact-url.js +1 -0
- package/dist/server/web-server/jwt/jwt.js +1 -1
- package/dist/server/web-server/jwt/types.d.ts +4 -4
- package/dist/server/web-server/jwt/types.js +1 -1
- package/dist/server/web-server/middleware/telemetry-middleware.js +1 -1
- package/dist/types/entitlements.d.ts +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=new Set(["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO","GB","CH","BR","JP","KR","CN","TR","ZA","TH","SA","IN","IL","AR","CA","AX","GP","MQ","GF","RE","YT","MF","GG","IM","JE","GI","SJ","FO","GL","MC","SM","VA","AD"]),i={"Africa/Abidjan":["CI"],"Africa/Accra":["GH"],"Africa/Addis_Ababa":["ET"],"Africa/Algiers":["DZ"],"Africa/Asmara":["ER"],"Africa/Asmera":["ER"],"Africa/Bamako":["ML"],"Africa/Bangui":["CF"],"Africa/Banjul":["GM"],"Africa/Bissau":["GW"],"Africa/Blantyre":["MW"],"Africa/Brazzaville":["CG"],"Africa/Bujumbura":["BI"],"Africa/Cairo":["EG"],"Africa/Casablanca":["MA"],"Africa/Ceuta":["ES"],"Africa/Conakry":["GN"],"Africa/Dakar":["SN"],"Africa/Dar_es_Salaam":["TZ"],"Africa/Djibouti":["DJ"],"Africa/Douala":["CM"],"Africa/El_Aaiun":["EH"],"Africa/Freetown":["SL"],"Africa/Gaborone":["BW"],"Africa/Harare":["ZW"],"Africa/Johannesburg":["ZA"],"Africa/Juba":["SS"],"Africa/Kampala":["UG"],"Africa/Khartoum":["SD"],"Africa/Kigali":["RW"],"Africa/Kinshasa":["CD"],"Africa/Lagos":["NG"],"Africa/Libreville":["GA"],"Africa/Lome":["TG"],"Africa/Luanda":["AO"],"Africa/Lubumbashi":["CD"],"Africa/Lusaka":["ZM"],"Africa/Malabo":["GQ"],"Africa/Maputo":["MZ"],"Africa/Maseru":["LS"],"Africa/Mbabane":["SZ"],"Africa/Mogadishu":["SO"],"Africa/Monrovia":["LR"],"Africa/Nairobi":["KE"],"Africa/Ndjamena":["TD"],"Africa/Niamey":["NE"],"Africa/Nouakchott":["MR"],"Africa/Ouagadougou":["BF"],"Africa/Porto-Novo":["BJ"],"Africa/Sao_Tome":["ST"],"Africa/Timbuktu":["ML"],"Africa/Tripoli":["LY"],"Africa/Tunis":["TN"],"Africa/Windhoek":["NA"],"America/Adak":["US"],"America/Anchorage":["US"],"America/Anguilla":["AI"],"America/Antigua":["AG"],"America/Araguaina":["BR"],"America/Argentina/Buenos_Aires":["AR"],"America/Argentina/Catamarca":["AR"],"America/Argentina/ComodRivadavia":["AR"],"America/Argentina/Cordoba":["AR"],"America/Argentina/Jujuy":["AR"],"America/Argentina/La_Rioja":["AR"],"America/Argentina/Mendoza":["AR"],"America/Argentina/Rio_Gallegos":["AR"],"America/Argentina/Salta":["AR"],"America/Argentina/San_Juan":["AR"],"America/Argentina/San_Luis":["AR"],"America/Argentina/Tucuman":["AR"],"America/Argentina/Ushuaia":["AR"],"America/Aruba":["AW"],"America/Asuncion":["PY"],"America/Atikokan":["CA"],"America/Atka":["US"],"America/Bahia":["BR"],"America/Bahia_Banderas":["MX"],"America/Barbados":["BB"],"America/Belem":["BR"],"America/Belize":["BZ"],"America/Blanc-Sablon":["CA"],"America/Boa_Vista":["BR"],"America/Bogota":["CO"],"America/Boise":["US"],"America/Buenos_Aires":["AR"],"America/Cambridge_Bay":["CA"],"America/Campo_Grande":["BR"],"America/Cancun":["MX"],"America/Caracas":["VE"],"America/Catamarca":["AR"],"America/Cayenne":["GF"],"America/Cayman":["KY"],"America/Chicago":["US"],"America/Chihuahua":["MX"],"America/Ciudad_Juarez":["MX"],"America/Coral_Harbour":["CA"],"America/Cordoba":["AR"],"America/Costa_Rica":["CR"],"America/Coyhaique":["CL"],"America/Creston":["CA"],"America/Cuiaba":["BR"],"America/Curacao":["CW"],"America/Danmarkshavn":["GL"],"America/Dawson":["CA"],"America/Dawson_Creek":["CA"],"America/Denver":["US"],"America/Detroit":["US"],"America/Dominica":["DM"],"America/Edmonton":["CA"],"America/Eirunepe":["BR"],"America/El_Salvador":["SV"],"America/Ensenada":["MX"],"America/Fort_Nelson":["CA"],"America/Fort_Wayne":["US"],"America/Fortaleza":["BR"],"America/Glace_Bay":["CA"],"America/Godthab":["GL"],"America/Goose_Bay":["CA"],"America/Grand_Turk":["TC"],"America/Grenada":["GD"],"America/Guadeloupe":["GP"],"America/Guatemala":["GT"],"America/Guayaquil":["EC"],"America/Guyana":["GY"],"America/Halifax":["CA"],"America/Havana":["CU"],"America/Hermosillo":["MX"],"America/Indiana/Indianapolis":["US"],"America/Indiana/Knox":["US"],"America/Indiana/Marengo":["US"],"America/Indiana/Petersburg":["US"],"America/Indiana/Tell_City":["US"],"America/Indiana/Vevay":["US"],"America/Indiana/Vincennes":["US"],"America/Indiana/Winamac":["US"],"America/Indianapolis":["US"],"America/Inuvik":["CA"],"America/Iqaluit":["CA"],"America/Jamaica":["JM"],"America/Jujuy":["AR"],"America/Juneau":["US"],"America/Kentucky/Louisville":["US"],"America/Kentucky/Monticello":["US"],"America/Knox_IN":["US"],"America/Kralendijk":["BQ"],"America/La_Paz":["BO"],"America/Lima":["PE"],"America/Los_Angeles":["US"],"America/Louisville":["US"],"America/Lower_Princes":["SX"],"America/Maceio":["BR"],"America/Managua":["NI"],"America/Manaus":["BR"],"America/Marigot":["MF"],"America/Martinique":["MQ"],"America/Matamoros":["MX"],"America/Mazatlan":["MX"],"America/Mendoza":["AR"],"America/Menominee":["US"],"America/Merida":["MX"],"America/Metlakatla":["US"],"America/Mexico_City":["MX"],"America/Miquelon":["PM"],"America/Moncton":["CA"],"America/Monterrey":["MX"],"America/Montevideo":["UY"],"America/Montreal":["CA"],"America/Montserrat":["MS"],"America/Nassau":["BS"],"America/New_York":["US"],"America/Nipigon":["CA"],"America/Nome":["US"],"America/Noronha":["BR"],"America/North_Dakota/Beulah":["US"],"America/North_Dakota/Center":["US"],"America/North_Dakota/New_Salem":["US"],"America/Nuuk":["GL"],"America/Ojinaga":["MX"],"America/Panama":["PA"],"America/Pangnirtung":["CA"],"America/Paramaribo":["SR"],"America/Phoenix":["US"],"America/Port-au-Prince":["HT"],"America/Port_of_Spain":["TT"],"America/Porto_Acre":["BR"],"America/Porto_Velho":["BR"],"America/Puerto_Rico":["PR"],"America/Punta_Arenas":["CL"],"America/Rainy_River":["CA"],"America/Rankin_Inlet":["CA"],"America/Recife":["BR"],"America/Regina":["CA"],"America/Resolute":["CA"],"America/Rio_Branco":["BR"],"America/Rosario":["AR"],"America/Santa_Isabel":["MX"],"America/Santarem":["BR"],"America/Santiago":["CL"],"America/Santo_Domingo":["DO"],"America/Sao_Paulo":["BR"],"America/Scoresbysund":["GL"],"America/Shiprock":["US"],"America/Sitka":["US"],"America/St_Barthelemy":["BL"],"America/St_Johns":["CA"],"America/St_Kitts":["KN"],"America/St_Lucia":["LC"],"America/St_Thomas":["VI"],"America/St_Vincent":["VC"],"America/Swift_Current":["CA"],"America/Tegucigalpa":["HN"],"America/Thule":["GL"],"America/Thunder_Bay":["CA"],"America/Tijuana":["MX"],"America/Toronto":["CA"],"America/Tortola":["VG"],"America/Vancouver":["CA"],"America/Virgin":["PR"],"America/Whitehorse":["CA"],"America/Winnipeg":["CA"],"America/Yakutat":["US"],"America/Yellowknife":["CA"],"Antarctica/Casey":["AQ"],"Antarctica/Davis":["AQ"],"Antarctica/DumontDUrville":["AQ"],"Antarctica/Macquarie":["AU"],"Antarctica/Mawson":["AQ"],"Antarctica/McMurdo":["AQ"],"Antarctica/Palmer":["AQ"],"Antarctica/Rothera":["AQ"],"Antarctica/South_Pole":["NZ"],"Antarctica/Syowa":["AQ"],"Antarctica/Troll":["AQ"],"Antarctica/Vostok":["AQ"],"Arctic/Longyearbyen":["SJ"],"Asia/Aden":["YE"],"Asia/Almaty":["KZ"],"Asia/Amman":["JO"],"Asia/Anadyr":["RU"],"Asia/Aqtau":["KZ"],"Asia/Aqtobe":["KZ"],"Asia/Ashgabat":["TM"],"Asia/Ashkhabad":["TM"],"Asia/Atyrau":["KZ"],"Asia/Baghdad":["IQ"],"Asia/Bahrain":["BH"],"Asia/Baku":["AZ"],"Asia/Bangkok":["TH"],"Asia/Barnaul":["RU"],"Asia/Beirut":["LB"],"Asia/Bishkek":["KG"],"Asia/Brunei":["BN"],"Asia/Calcutta":["IN"],"Asia/Chita":["RU"],"Asia/Choibalsan":["MN"],"Asia/Chongqing":["CN"],"Asia/Chungking":["CN"],"Asia/Colombo":["LK"],"Asia/Dacca":["BD"],"Asia/Damascus":["SY"],"Asia/Dhaka":["BD"],"Asia/Dili":["TL"],"Asia/Dubai":["AE"],"Asia/Dushanbe":["TJ"],"Asia/Famagusta":["CY"],"Asia/Gaza":["PS"],"Asia/Harbin":["CN"],"Asia/Hebron":["PS"],"Asia/Ho_Chi_Minh":["VN"],"Asia/Hong_Kong":["HK"],"Asia/Hovd":["MN"],"Asia/Irkutsk":["RU"],"Asia/Istanbul":["TR"],"Asia/Jakarta":["ID"],"Asia/Jayapura":["ID"],"Asia/Jerusalem":["IL"],"Asia/Kabul":["AF"],"Asia/Kamchatka":["RU"],"Asia/Karachi":["PK"],"Asia/Kashgar":["CN"],"Asia/Kathmandu":["NP"],"Asia/Katmandu":["NP"],"Asia/Khandyga":["RU"],"Asia/Kolkata":["IN"],"Asia/Krasnoyarsk":["RU"],"Asia/Kuala_Lumpur":["MY"],"Asia/Kuching":["MY"],"Asia/Kuwait":["KW"],"Asia/Macao":["MO"],"Asia/Macau":["MO"],"Asia/Magadan":["RU"],"Asia/Makassar":["ID"],"Asia/Manila":["PH"],"Asia/Muscat":["OM"],"Asia/Nicosia":["CY"],"Asia/Novokuznetsk":["RU"],"Asia/Novosibirsk":["RU"],"Asia/Omsk":["RU"],"Asia/Oral":["KZ"],"Asia/Phnom_Penh":["KH"],"Asia/Pontianak":["ID"],"Asia/Pyongyang":["KP"],"Asia/Qatar":["QA"],"Asia/Qostanay":["KZ"],"Asia/Qyzylorda":["KZ"],"Asia/Rangoon":["MM"],"Asia/Riyadh":["SA"],"Asia/Saigon":["VN"],"Asia/Sakhalin":["RU"],"Asia/Samarkand":["UZ"],"Asia/Seoul":["KR"],"Asia/Shanghai":["CN"],"Asia/Singapore":["SG"],"Asia/Srednekolymsk":["RU"],"Asia/Taipei":["TW"],"Asia/Tashkent":["UZ"],"Asia/Tbilisi":["GE"],"Asia/Tehran":["IR"],"Asia/Tel_Aviv":["IL"],"Asia/Thimbu":["BT"],"Asia/Thimphu":["BT"],"Asia/Tokyo":["JP"],"Asia/Tomsk":["RU"],"Asia/Ujung_Pandang":["ID"],"Asia/Ulaanbaatar":["MN"],"Asia/Ulan_Bator":["MN"],"Asia/Urumqi":["CN"],"Asia/Ust-Nera":["RU"],"Asia/Vientiane":["LA"],"Asia/Vladivostok":["RU"],"Asia/Yakutsk":["RU"],"Asia/Yangon":["MM"],"Asia/Yekaterinburg":["RU"],"Asia/Yerevan":["AM"],"Atlantic/Azores":["PT"],"Atlantic/Bermuda":["BM"],"Atlantic/Canary":["ES"],"Atlantic/Cape_Verde":["CV"],"Atlantic/Faeroe":["FO"],"Atlantic/Faroe":["FO"],"Atlantic/Jan_Mayen":["DE"],"Atlantic/Madeira":["PT"],"Atlantic/Reykjavik":["IS"],"Atlantic/South_Georgia":["GS"],"Atlantic/St_Helena":["SH"],"Atlantic/Stanley":["FK"],"Australia/ACT":["AU"],"Australia/Adelaide":["AU"],"Australia/Brisbane":["AU"],"Australia/Broken_Hill":["AU"],"Australia/Canberra":["AU"],"Australia/Currie":["AU"],"Australia/Darwin":["AU"],"Australia/Eucla":["AU"],"Australia/Hobart":["AU"],"Australia/LHI":["AU"],"Australia/Lindeman":["AU"],"Australia/Lord_Howe":["AU"],"Australia/Melbourne":["AU"],"Australia/NSW":["AU"],"Australia/North":["AU"],"Australia/Perth":["AU"],"Australia/Queensland":["AU"],"Australia/South":["AU"],"Australia/Sydney":["AU"],"Australia/Tasmania":["AU"],"Australia/Victoria":["AU"],"Australia/West":["AU"],"Australia/Yancowinna":["AU"],"Brazil/Acre":["BR"],"Brazil/DeNoronha":["BR"],"Brazil/East":["BR"],"Brazil/West":["BR"],CET:["BE"],"Canada/Atlantic":["CA"],"Canada/Central":["CA"],"Canada/Eastern":["CA"],"Canada/Mountain":["CA"],"Canada/Newfoundland":["CA"],"Canada/Pacific":["CA"],"Canada/Saskatchewan":["CA"],"Canada/Yukon":["CA"],"Chile/Continental":["CL"],"Chile/EasterIsland":["CL"],Cuba:["CU"],EET:["GR"],EST:["US"],Egypt:["EG"],Eire:["IE"],"Europe/Amsterdam":["NL"],"Europe/Andorra":["AD"],"Europe/Astrakhan":["RU"],"Europe/Athens":["GR"],"Europe/Belfast":["GB"],"Europe/Belgrade":["RS"],"Europe/Berlin":["DE"],"Europe/Bratislava":["SK"],"Europe/Brussels":["BE"],"Europe/Bucharest":["RO"],"Europe/Budapest":["HU"],"Europe/Busingen":["DE"],"Europe/Chisinau":["MD"],"Europe/Copenhagen":["DK"],"Europe/Dublin":["IE"],"Europe/Gibraltar":["GI"],"Europe/Guernsey":["GG"],"Europe/Helsinki":["FI"],"Europe/Isle_of_Man":["IM"],"Europe/Istanbul":["TR"],"Europe/Jersey":["JE"],"Europe/Kaliningrad":["RU"],"Europe/Kiev":["UA"],"Europe/Kirov":["RU"],"Europe/Kyiv":["UA"],"Europe/Lisbon":["PT"],"Europe/Ljubljana":["SI"],"Europe/London":["GB"],"Europe/Luxembourg":["LU"],"Europe/Madrid":["ES"],"Europe/Malta":["MT"],"Europe/Mariehamn":["AX"],"Europe/Minsk":["BY"],"Europe/Monaco":["MC"],"Europe/Moscow":["RU"],"Europe/Nicosia":["CY"],"Europe/Oslo":["NO"],"Europe/Paris":["FR"],"Europe/Podgorica":["ME"],"Europe/Prague":["CZ"],"Europe/Riga":["LV"],"Europe/Rome":["IT"],"Europe/Samara":["RU"],"Europe/San_Marino":["SM"],"Europe/Sarajevo":["BA"],"Europe/Saratov":["RU"],"Europe/Simferopol":["UA"],"Europe/Skopje":["MK"],"Europe/Sofia":["BG"],"Europe/Stockholm":["SE"],"Europe/Tallinn":["EE"],"Europe/Tirane":["AL"],"Europe/Tiraspol":["MD"],"Europe/Ulyanovsk":["RU"],"Europe/Uzhgorod":["UA"],"Europe/Vaduz":["LI"],"Europe/Vatican":["VA"],"Europe/Vienna":["AT"],"Europe/Vilnius":["LT"],"Europe/Volgograd":["RU"],"Europe/Warsaw":["PL"],"Europe/Zagreb":["HR"],"Europe/Zaporozhye":["UA"],"Europe/Zurich":["CH"],GB:["GB"],"GB-Eire":["GB"],HST:["US"],Hongkong:["HK"],Iceland:["IS"],"Indian/Antananarivo":["MG"],"Indian/Chagos":["IO"],"Indian/Christmas":["CX"],"Indian/Cocos":["CC"],"Indian/Comoro":["KM"],"Indian/Kerguelen":["TF"],"Indian/Mahe":["SC"],"Indian/Maldives":["MV"],"Indian/Mauritius":["MU"],"Indian/Mayotte":["YT"],"Indian/Reunion":["RE"],Iran:["IR"],Israel:["IL"],Jamaica:["JM"],Japan:["JP"],Kwajalein:["MH"],Libya:["LY"],MET:["BE"],MST:["US"],"Mexico/BajaNorte":["MX"],"Mexico/BajaSur":["MX"],"Mexico/General":["MX"],NZ:["NZ"],"NZ-CHAT":["NZ"],Navajo:["US"],PRC:["CN"],"Pacific/Apia":["WS"],"Pacific/Auckland":["NZ"],"Pacific/Bougainville":["PG"],"Pacific/Chatham":["NZ"],"Pacific/Chuuk":["FM"],"Pacific/Easter":["CL"],"Pacific/Efate":["VU"],"Pacific/Enderbury":["KI"],"Pacific/Fakaofo":["TK"],"Pacific/Fiji":["FJ"],"Pacific/Funafuti":["TV"],"Pacific/Galapagos":["EC"],"Pacific/Gambier":["PF"],"Pacific/Guadalcanal":["SB"],"Pacific/Guam":["GU"],"Pacific/Honolulu":["US"],"Pacific/Johnston":["US"],"Pacific/Kanton":["KI"],"Pacific/Kiritimati":["KI"],"Pacific/Kosrae":["FM"],"Pacific/Kwajalein":["MH"],"Pacific/Majuro":["MH"],"Pacific/Marquesas":["PF"],"Pacific/Midway":["UM"],"Pacific/Nauru":["NR"],"Pacific/Niue":["NU"],"Pacific/Norfolk":["NF"],"Pacific/Noumea":["NC"],"Pacific/Pago_Pago":["AS"],"Pacific/Palau":["PW"],"Pacific/Pitcairn":["PN"],"Pacific/Pohnpei":["FM"],"Pacific/Ponape":["SB"],"Pacific/Port_Moresby":["PG"],"Pacific/Rarotonga":["CK"],"Pacific/Saipan":["MP"],"Pacific/Samoa":["AS"],"Pacific/Tahiti":["PF"],"Pacific/Tarawa":["KI"],"Pacific/Tongatapu":["TO"],"Pacific/Truk":["PG"],"Pacific/Wake":["UM"],"Pacific/Wallis":["WF"],"Pacific/Yap":["PG"],Poland:["PL"],Portugal:["PT"],ROC:["TW"],ROK:["KR"],Singapore:["SG"],Turkey:["TR"],"US/Alaska":["US"],"US/Aleutian":["US"],"US/Arizona":["US"],"US/Central":["US"],"US/East-Indiana":["US"],"US/Eastern":["US"],"US/Hawaii":["US"],"US/Indiana-Starke":["US"],"US/Michigan":["US"],"US/Mountain":["US"],"US/Pacific":["US"],"US/Samoa":["AS"],"W-SU":["RU"],WET:["PT"]};export{a as OPT_IN_COUNTRIES,i as TZ_COUNTRIES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{envConfig as
|
|
1
|
+
import{envConfig as i}from"../../../config/env-config.js";import{gateSsrComponents as e}from"../../consent/gate-ssr-components.js";import{buildScript as s}from"./build-script.js";import{resolveBrowserHooksPath as a}from"./resolve-browser-hooks.js";async function m(){return{id:"Adobe Analytics",requiredEntitlements:["analytics"],async processContent(o,{getConfig:r}){const t=await r(),n=t?.analytics?.adobe;!n?.scriptUrl||!i.isProductionEnv&&!n.includeInDevelopment||(o.addSsrComponents(e([s(n.scriptUrl)],"analytics",t.consent),"head"),o.addBrowserPlugin(a()))}}}export{m as adobeAnalyticsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o=(n,t)=>{if(!t?.analytics?.amplitude)return;const{location:e}=n;typeof window.amplitudeExcludePaths<"u"&&window.amplitudeExcludePaths.some(i=>i.test(e.pathname))||window.amplitude.getInstance().logEvent(window.amplitudeEventTypes.pageView,{location:e?e.pathname+e.search+e.hash:void 0})};export{o as onRouteChange};
|
|
1
|
+
const o=(n,t)=>{if(!t?.analytics?.amplitude)return;const{location:e}=n;typeof window.amplitudeExcludePaths<"u"&&window.amplitudeExcludePaths.some(i=>i.test(e.pathname))||window.amplitude?.getInstance&&window.amplitude.getInstance().logEvent(window.amplitudeEventTypes.pageView,{location:e?e.pathname+e.search+e.hash:void 0})};export{o as onRouteChange};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Minimatch as
|
|
1
|
+
import{Minimatch as d}from"minimatch";import{envConfig as c}from"../../../config/env-config.js";import{gateSsrComponents as s}from"../../consent/gate-ssr-components.js";import{buildScripts as l}from"./build-scripts.js";import{resolveBrowserHooksPath as u}from"./resolve-browser-hooks.js";async function P(){return{id:"Amplitude Analytics",requiredEntitlements:["analytics"],async processContent(t,{getConfig:r}){const e=await r(),n=e?.analytics?.amplitude;if(!n?.apiKey||!c.isProductionEnv&&!n.includeInDevelopment)return;let o=[];typeof n.exclude<"u"&&n.exclude.map(p=>{const i=new d(p).makeRe();i&&o.push(i)});const{headComponents:m,postBodyComponents:a}=l(n,o);t.addSsrComponents(s(m,"analytics",e.consent),"head"),t.addSsrComponents(s(a,"analytics",e.consent),"postBody"),t.addBrowserPlugin(u())}}}export{P as amplitudeAnalyticsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{envConfig as r}from"../../../config/env-config.js";import{buildScript as
|
|
1
|
+
import{envConfig as r}from"../../../config/env-config.js";import{gateSsrComponents as e}from"../../consent/gate-ssr-components.js";import{buildScript as c}from"./build-script.js";async function u(){return{id:"Fullstory Analytics",requiredEntitlements:["analytics"],async processContent(o,{getConfig:i}){const t=await i(),n=t?.analytics?.fullstory;if(!n?.orgId||!r.isProductionEnv&&!n.includeInDevelopment)return;const s=[c(n.orgId)];o.addSsrComponents(e(s,"analytics",t.consent),"head")}}}export{u as fullstoryAnalyticsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{withPathPrefix as
|
|
1
|
+
import{withPathPrefix as d}from"@redocly/theme/core/utils";import{envConfig as g}from"../../../config/env-config.js";import{normalizeRouteSlug as a}from"../../../../utils/path/normalize-route-slug.js";import{gateSsrComponents as s}from"../../consent/gate-ssr-components.js";import{buildScripts as u}from"./build-scripts.js";import{resolveBrowserHooksPath as f}from"./resolve-browser-hooks.js";async function C(){const r=g.isProductionEnv;return{id:"Google Analytics",requiredEntitlements:["analytics"],afterRoutesCreated(e){const t=e.getGlobalData()||{},o=t.analytics?.ga||{trackingId:""};o?.exclude||(o.exclude=[]),o.trackers={};for(const i of Object.values(t.products||{})){const n=i.configOverride?.analytics?.ga;!n||!r&&!n.includeInDevelopment||(n.exclude?.length&&o.exclude.push(...n.exclude),o.trackers[a(i.slug)]=n)}if(o.trackingId&&(r||o.includeInDevelopment)&&(o.trackers[a(d("/"))]={trackingId:o.trackingId,conversionId:o.conversionId,floodlightId:o.floodlightId,optimizeId:o.optimizeId}),e.setGlobalData({...t,analytics:{...t?.analytics,ga:o}}),!Object.keys(o.trackers).length)return;const{headComponents:c,postBodyComponents:l}=u(o);e.addSsrComponents(s(c,"analytics",t.consent),"head"),e.addSsrComponents(s(l,"analytics",t.consent),"postBody"),e.addBrowserPlugin(f())}}}export{C as googleAnalyticsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{onCLS as
|
|
1
|
+
import{onCLS as f,onFID as l,onLCP as p}from"web-vitals";import{envConfig as w}from"../../../config/env-config.js";import{debounce as s}from"../../../../utils/time/debounce.js";const r=new Set,y=(n,a)=>{const e=a?.analytics?.gtm;if(!e||w.NODE_ENV!=="production"&&!e.includeInDevelopment)return;const t=window.redocly?.consent;if(t&&!t.state.analytics){if(e.enableWebVitalsTracking&&!n.prevLocation){const u=t.on("change",m=>{m.analytics&&(u(),d(e.dataLayerName))})}return}e.enableWebVitalsTracking&&!n.prevLocation&&d(e.dataLayerName);const o=e.dataLayerName||"dataLayer",i=window;i[o]=i[o]||[];const c=e.pageViewEventName?e.pageViewEventName:"pageView";i[o].push({event:c})};function d(n="dataLayer"){const a=window;function e(c){r.has(c.name)||(r.add(c.name),L(c,a[n]))}const t=s(e,3e3),o=e,i=s(e,3e3);f(t),l(o),p(i)}function L({name:n,value:a,id:e},t){t.push({event:"core-web-vitals",webVitalsMeasurement:{name:n,id:e,value:Math.round(n==="CLS"?a*1e3:a),nonInteraction:!0}})}export{y as onRouteChange};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{envConfig as
|
|
1
|
+
import{envConfig as a}from"../../../config/env-config.js";import{gateSsrComponents as e}from"../../consent/gate-ssr-components.js";import{buildScripts as c}from"./build-scripts.js";import{resolveBrowserHooksPath as m}from"./resolve-browser-hooks.js";async function u(){return{id:"Google Tag Manager Analytics",requiredEntitlements:["analytics"],async processContent(n,{getConfig:r}){const o=await r(),t=o?.analytics?.gtm;if(!t?.trackingId||!a.isProductionEnv&&!t.includeInDevelopment)return;const{headComponents:s,preBodyComponents:i}=c(t);n.addSsrComponents(e(s,"analytics",o.consent),"head"),n.addSsrComponents(e(i,"analytics",o.consent),"preBody"),n.addBrowserPlugin(m())}}}export{u as gtmAnalyticsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const h=(r,o)=>{const e=o?.analytics?.heap;if(e?.appId&&!r.prevLocation){const n=window.redocly?.consent;if(n&&!n.state.analytics){const t=n.on("change",a=>{a.analytics&&(t(),i(e.appId))});return}i(e.appId)}};function i(r){window.heap=window.heap||[],window.heap.load=function(o,e){window.heap.appid=o,window.heap.config=e=e||{};let n=e.forceSSL||document.location.protocol==="https:",t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=(n?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+o+".js";let a=document.getElementsByTagName("script")[0];a.parentNode?.insertBefore(t,a);for(let s=function(d){return function(...l){window.heap.push([d].concat(Array.prototype.slice.call(l,0)))}},c=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],p=0;p<c.length;p++)window.heap[c[p]]=s(c[p])},window.heap.load(r)}export{h as onRouteChange};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{envConfig as e}from"../../../config/env-config.js";import{
|
|
1
|
+
import{envConfig as e}from"../../../config/env-config.js";import{gateSsrComponents as i}from"../../consent/gate-ssr-components.js";import{buildScript as s}from"./build-script.js";import{resolveBrowserHooksPath as a}from"./resolve-browser-hooks.js";async function m(){return{id:"Rudderstack Analytics",requiredEntitlements:["analytics"],async processContent(t,{getConfig:o}){const r=await o(),n=r?.analytics?.rudderstack;!n?.writeKey||!e.isProductionEnv&&!n.includeInDevelopment||(t.addSsrComponents(i([s(n)],"analytics",r.consent),"head"),t.addBrowserPlugin(a()))}}}export{m as rudderstackAnalyticsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{envConfig as i}from"../../../config/env-config.js";import{buildScript as
|
|
1
|
+
import{envConfig as i}from"../../../config/env-config.js";import{gateSsrComponents as r}from"../../consent/gate-ssr-components.js";import{buildScript as s}from"./build-script.js";import{resolveBrowserHooksPath as a}from"./resolve-browser-hooks.js";async function d(){return{id:"Segment Analytics",requiredEntitlements:["analytics"],async processContent(t,{getConfig:o}){const e=await o(),n=e?.analytics?.segment;!n?.writeKey||!i.isProductionEnv&&!n.includeInDevelopment||(t.addSsrComponents(r([s(n)],"analytics",e.consent),"head"),t.addBrowserPlugin(a()))}}}export{d as segmentAnalyticsPlugin};
|
|
@@ -2,6 +2,7 @@ import type { RedoclyConfig } from '@redocly/config';
|
|
|
2
2
|
export declare function formatCustomScripts(customScripts: NonNullable<RedoclyConfig['scripts']>['head'], opts: {
|
|
3
3
|
contentDir: string;
|
|
4
4
|
outdir: string;
|
|
5
|
+
consentEnabled?: boolean;
|
|
5
6
|
}): Promise<string>;
|
|
6
7
|
export declare function formatCustomLinks(customLinks: RedoclyConfig['links'], opts: {
|
|
7
8
|
contentDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as
|
|
1
|
+
import{readFileSync as g}from"fs";import{join as j}from"path";import{isLocalLink as p}from"../../../utils/path/is-local-link.js";import{copyStaticFile as x}from"../../utils/fs.js";async function T(n,t){return m(n,"src",(e,o)=>`<script ${e}>${o}</script>`,t)}async function b(n,t){return m(n,"href",e=>`<link ${e} />`,{...t,defaultAttrs:{rel:"stylesheet"}})}async function m(n=[],t,e,{contentDir:o,outdir:y,defaultAttrs:h={},consentEnabled:d=!1}){if(!Array.isArray(n)||!n.length)return"";const c=[];for(const i of n){const C=typeof i=="string"?{[t]:i}:{...i},{src:$,href:k,inline:a,consent:l,...s}=C;l&&d&&t==="src"&&(s["data-consent"]=l,s.type&&(s["data-consent-type"]=s.type),s.type="text/plain");let r=t==="href"?k:$,u="";if(p(r)&&!a){const f=await x(o,r,y);if(!f)continue;r=f}else p(r)&&a&&(u=g(j(o,r),"utf-8"),r=!1);const S=F({...h,...s,[t]:r});c.push(e(S,u))}return c.join("")}function F(n){const t=[];for(let e in n){const o=n[e];o!==!1&&(o===!0?t.push(e):t.push(`${e}="${o}"`))}return t.join(" ")}export{b as formatCustomLinks,T as formatCustomScripts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import A from"path";import{REDOCLY_ROUTE_RBAC as
|
|
1
|
+
import A from"path";import{REDOCLY_ROUTE_RBAC as b,REDOCLY_TEAMS_RBAC as g}from"@redocly/config";import{deepMerge as S}from"../../../utils/object/deep-merge.js";import{parsePathVersions as v}from"../../../utils/path/parse-path-versions.js";import{buildWildcardRedirectsTree as D}from"../../utils/redirects/build-wildcard-redirects-tree.js";import{shaHexShort as T}from"../../utils/crypto/sha-hex-short.js";import{formatCustomScripts as u,formatCustomLinks as w}from"./format-custom-tags.js";import{applyL10nToRbacConfig as L,resolveDirectoryHashes as O}from"../../utils/rbac.js";import{isConsentEnabled as E}from"../consent/is-consent-enabled.js";import{copySeoAssets as k}from"./copy-seo-assets.js";import{normalizeRedirectSources as G}from"./normalize-redirect-sources.js";import{applyL10nToRedirects as B}from"./apply-l10n-to-redirects.js";import{DEFAULT_LOADERS as _}from"./loaders/index.js";import{resolveSearchFacets as j}from"./resolve-search-facets.js";import{telemetryTraceStep as x}from"../../../cli/telemetry/helpers/trace-step.js";import{transformMdAst as F}from"../markdown/runtime-transform.js";async function er(){return{id:"Config Parser",loaders:_,async processContent(e,{getConfig:n,fs:t}){await x("com.redocly.build.plugin.configParser",async o=>{const{contentDir:l,setGlobalConfig:s,setGlobalData:a}=e,r=await n(),i=r.access||{},d=L(t,i.rbac||{}),f={outdir:e.outdir,contentDir:l,consentEnabled:E(r.consent)},y=await u(r.scripts?.head,f),h=await w(r.links,f),R=await u(r.scripts?.body,f),m=S(r,{headScriptTags:y,linkTags:h,postBodyScriptTags:R});o?.setAttribute("config",JSON.stringify(m));const p=r.redirects?G(r.redirects):{},C=Object.keys(p),P=m.banner?.map(c=>typeof c=="object"&&c!==null&&c.rbac?{...c,[g]:c.rbac}:c);s({...m,banner:P,access:{...i,requiresLogin:!!i.requiresLogin,rbac:d},directoryPaths:await O(t,i.rbac),seo:r.seo&&await k(r.seo,f.contentDir,f.outdir),redirects:B(p,r.l10n),wildcardRedirectsTree:D(p),originalRedirectSources:C}),j(r.search?.filters?.facets||[],e.getSearchFacets,e.setSearchFacets),a({removeAttribution:!!r.removeAttribution})})},async afterRoutesCreated(e,n){M(e);const t=e.getGlobalConfig("banner");if(Array.isArray(t)){const o=await Promise.all(t.map(async(l,s)=>{const{content:a,...r}=l,{ast:i}=await e.parseMarkdoc({input:{content:a,relativePath:"redocly.yaml"},context:n,resource:`redocly.yaml#banner${s}`}),{renderableAst:d}=await F(i,{variables:{},partials:{}},e.serverOutDir);return{...r,ast:d,hash:T(a)}}));e.setGlobalConfig({banner:o})}}}}function M(e){const n=e.getGlobalConfig("access")?.rbac,t=e.getGlobalConfig("directoryPaths");if(!(!n||Object.keys(n).length===0))for(const o of e.getAllRoutes()){if(o.versions&&t){const l=v(o.fsPath)?.filePathInVersion||"index.md";for(const s of o.versions){const a=t[s.folderId],i=a==="."||a==="/"?"":a;s[b]={slug:s.link,fsPath:A.posix.join(i,"@"+s.version,l)}}}o[b]||o[g]||(o[b]={slug:o.slug,fsPath:o.fsPath})}}export{er as configParserPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_SEARCH_ENGINE as
|
|
1
|
+
import{DEFAULT_SEARCH_ENGINE as p,redocConfigSchema as A,rootRedoclyConfigSchema as i}from"@redocly/config";import F from"is-glob";import{I18N_DIR_NAME as u,L10N_DIR_NAME as l}from"../../../constants/common.js";import{CONFIG_FILE_NAME as f}from"../../../../constants/common.js";import{deepMerge as C}from"../../../../utils/object/deep-merge.js";import{logger as o}from"../../../tools/notifiers/logger.js";import{EntitlementsProvider as b}from"../../../entitlements/entitlements-provider.js";import{readAndValidateConfig as h}from"./utils/read-and-validate-config.js";import{resolveExternalPlugins as y}from"../../../external-plugins/resolve-external-plugins.js";import{getPathForAllLocales as m}from"../../../fs/utils/get-path-for-all-locales.js";import{parseRbacConfig as E}from"../../../utils/rbac.js";import{RbacConfigLocation as S,validateRbacConfig as v}from"../../validate-rbac-config.js";const R=["**/_partials/**"],$=async(e,{fs:n},s)=>{const r=await h(e,n,s,async t=>e===f?L(n.cwd,t?.plugins||[]):void 0);if(r?.access?.rbac){const t=await E(r.access.rbac);r.access.rbac=t,v(t,e===f?S.RootRedoclyYaml:void 0)}(r?.l10n||r?.i18n)&&(r.l10n=w(r),r.i18n=void 0);const c=C(r||{},{markdown:{partialsFolders:(r?.markdown?.partialsFolders||R).flatMap(t=>m(t,n))}});return _({...c,configPath:e,ignore:g(r?.ignore,n)})};async function L(e,n){const s=await y(e,n),r=s.map(a=>a.config.schema?a.lifecyclePlugin.id:""),c={};for(const a of s){const d=a.lifecyclePlugin?.id;a.config.schema&&d&&i.properties&&(c[d]=a.config.schema)}return{...i,properties:{...c,...i.properties,openapi:A},$id:i.$id+r.join("")}}function _(e){const n=b.instance();if(n.canAccessFeature("apiFunctions")||(e.apiFunctions=void 0),n.canAccessFeature("products")||(e.products=void 0),n.canAccessFeature("breadcrumbs")||(e.breadcrumbs={hide:!0}),n.canAccessFeature("seo")||(e.seo={llmstxt:{hide:!0}}),n.canAccessFeature("redirects")||(e.redirects={}),n.canAccessFeature("l10n")||(e.l10n=void 0),n.canAccessFeature("rbac")||e.access&&(e.access.rbac=void 0),n.canAccessFeature("sso")||e.access&&(e.access.sso=void 0),n.canAccessFeature("ssoDirect")||(e.ssoDirect=void 0),n.canAccessFeature("catalogClassic")||(e.catalog=void 0,e.catalogClassic=void 0),n.canAccessFeature("scorecard")||(e.scorecard=void 0,e.scorecardClassic=void 0),n.canAccessFeature("scorecards")||(e.scorecards=void 0),n.canAccessFeature("devOnboarding")||(e.developerOnboarding=void 0),n.canAccessFeature("analytics")||(e.analytics=void 0),n.canAccessFeature("removeAttribution")||(e.removeAttribution=void 0),n.canAccessFeature("mockServer")||(e.mockServer={off:!0}),n.canAccessFeature("advancedSearch")||e.search&&(e.search.engine=p),n.canAccessFeature("banner")||(e.banner=void 0),e.consent){const s=n.entitlements;s&&!Object.prototype.hasOwnProperty.call(s,"cookieConsent")?o.warn("The plan gates token has no cookieConsent entry. The consent option stays on."):n.canAccessFeature("cookieConsent")||(o.error("The consent option requires the Enterprise+ plan. It is ignored, and analytics loads without consent."),e.consent=void 0)}return e}function g(e=[],n){return["static",...e].flatMap(s=>F(s)&&(s.startsWith("*")||s.startsWith(l)||s.startsWith("/"+l)||s.startsWith(u)||s.startsWith("/"+u))?s:m(s,n))}function w(e){return e.i18n&&o.warn("The `i18n` configuration is deprecated. Please use `l10n` instead."),e.l10n||e.i18n||{}}export{$ as redoclyConfigLoader};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ConsentConfig } from '@redocly/config';
|
|
2
|
+
export type ConsentScriptOptions = {
|
|
3
|
+
dataLayerName?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function buildConsentScript(consent: ConsentConfig, options?: ConsentScriptOptions): string;
|
|
6
|
+
//# sourceMappingURL=build-consent-script.d.ts.map
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import{buildZoneModes as a,groupZones as r}from"./zone-modes.js";const i=365,o="dataLayer";function c(e,t={}){const n=e.mode==="auto"?r(a().optOut):{};return`(function(){
|
|
2
|
+
var cfg=${JSON.stringify({mode:e.mode,expires:e.expires??i,dataLayer:t.dataLayerName||o,optOut:n}).replace(/</g,"\\u003c")};
|
|
3
|
+
var COOKIE='redocly_consent';
|
|
4
|
+
var tcfState=null;
|
|
5
|
+
var adapters={
|
|
6
|
+
onetrust:{
|
|
7
|
+
ready:function(){return !!window.OneTrust&&typeof window.OnetrustActiveGroups==='string';},
|
|
8
|
+
read:function(){
|
|
9
|
+
var raw=window.OnetrustActiveGroups||'';
|
|
10
|
+
var groups=','+raw+',';
|
|
11
|
+
var decided=!!(window.OneTrust.IsAlertBoxClosed&&window.OneTrust.IsAlertBoxClosed());
|
|
12
|
+
var ids=raw.split(',');
|
|
13
|
+
for(var i=0;i<ids.length;i++){if(ids[i]&&ids[i]!=='C0001'){decided=true;}}
|
|
14
|
+
return {analytics:groups.indexOf(',C0002,')>-1,marketing:groups.indexOf(',C0004,')>-1,decided:decided};
|
|
15
|
+
},
|
|
16
|
+
subscribe:function(read){
|
|
17
|
+
if(window.OneTrust.OnConsentChanged){window.OneTrust.OnConsentChanged(function(){read();});}
|
|
18
|
+
var previous=window.OptanonWrapper;
|
|
19
|
+
window.OptanonWrapper=function(){
|
|
20
|
+
if(typeof previous==='function'){previous();}
|
|
21
|
+
read();
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
open:function(){window.OneTrust.ToggleInfoDisplay();return true;}
|
|
25
|
+
},
|
|
26
|
+
cookiebot:{
|
|
27
|
+
ready:function(){return !!(window.Cookiebot&&window.Cookiebot.consent);},
|
|
28
|
+
read:function(){
|
|
29
|
+
var cb=window.Cookiebot;
|
|
30
|
+
return {analytics:cb.consent.statistics===true,marketing:cb.consent.marketing===true,decided:cb.consented===true||cb.declined===true};
|
|
31
|
+
},
|
|
32
|
+
subscribe:function(read){
|
|
33
|
+
var events=['CookiebotOnConsentReady','CookiebotOnAccept','CookiebotOnDecline'];
|
|
34
|
+
for(var i=0;i<events.length;i++){window.addEventListener(events[i],function(){read();});}
|
|
35
|
+
},
|
|
36
|
+
open:function(){window.Cookiebot.renew();return true;}
|
|
37
|
+
},
|
|
38
|
+
trustarc:{
|
|
39
|
+
ready:function(){return !!(window.truste&&window.truste.cma&&typeof window.truste.cma.callApi==='function');},
|
|
40
|
+
read:function(){
|
|
41
|
+
var d=window.truste.cma.callApi('getConsentDecision',window.location.host)||{};
|
|
42
|
+
var buckets=d.consentDecision||[];
|
|
43
|
+
var decided=d.source==='asserted';
|
|
44
|
+
for(var i=0;i<buckets.length;i++){if(buckets[i]!==0){decided=true;}}
|
|
45
|
+
return {analytics:buckets.indexOf(2)>-1,marketing:buckets.indexOf(3)>-1,decided:decided};
|
|
46
|
+
},
|
|
47
|
+
subscribe:function(read){
|
|
48
|
+
window.addEventListener('message',function(event){
|
|
49
|
+
if(typeof event.data!=='string'||event.data.indexOf('PrivacyManager:')!==0){return;}
|
|
50
|
+
var payload=null;
|
|
51
|
+
try{payload=JSON.parse(event.data.slice('PrivacyManager:'.length));}catch(e){return;}
|
|
52
|
+
if(payload&&payload.source==='preference_manager'&&payload.message==='submit_preferences'){read();}
|
|
53
|
+
});
|
|
54
|
+
window.addEventListener('load',function(){read();});
|
|
55
|
+
},
|
|
56
|
+
open:function(){
|
|
57
|
+
if(!window.truste.eu||typeof window.truste.eu.clickListener!=='function'){return false;}
|
|
58
|
+
window.truste.eu.clickListener();return true;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
tcf:{
|
|
62
|
+
ready:function(){return typeof window.__tcfapi==='function';},
|
|
63
|
+
read:function(){return tcfState;},
|
|
64
|
+
subscribe:function(read){
|
|
65
|
+
window.__tcfapi('addEventListener',2,function(tcData,success){
|
|
66
|
+
if(!success||!tcData){return;}
|
|
67
|
+
if(tcData.eventStatus!=='tcloaded'&&tcData.eventStatus!=='useractioncomplete'){return;}
|
|
68
|
+
var consents=(tcData.purpose&&tcData.purpose.consents)||{};
|
|
69
|
+
var base=consents[1]===true;
|
|
70
|
+
tcfState={
|
|
71
|
+
analytics:base&&(consents[8]===true||consents[9]===true||consents[10]===true),
|
|
72
|
+
marketing:base&&(consents[2]===true||consents[3]===true||consents[4]===true),
|
|
73
|
+
decided:true
|
|
74
|
+
};
|
|
75
|
+
read();
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
open:function(){
|
|
79
|
+
if(window.Didomi&&window.Didomi.preferences&&typeof window.Didomi.preferences.show==='function'){window.Didomi.preferences.show();return true;}
|
|
80
|
+
if(window.UC_UI&&typeof window.UC_UI.showSecondLayer==='function'){window.UC_UI.showSecondLayer();return true;}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var adapter=adapters[cfg.mode]||null;
|
|
86
|
+
function readCookie(){
|
|
87
|
+
var m=document.cookie.match(/(?:^|; )redocly_consent=([^;]*)/);
|
|
88
|
+
if(!m){return null;}
|
|
89
|
+
try{return JSON.parse(decodeURIComponent(m[1]));}catch(e){return null;}
|
|
90
|
+
}
|
|
91
|
+
function writeCookie(s){
|
|
92
|
+
var v=encodeURIComponent(JSON.stringify({v:1,analytics:s.analytics,marketing:s.marketing,ts:Date.now()}));
|
|
93
|
+
document.cookie=COOKIE+'='+v+'; Max-Age='+(cfg.expires*86400)+'; Path=/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');
|
|
94
|
+
}
|
|
95
|
+
function detectRegion(){
|
|
96
|
+
var tz=null;
|
|
97
|
+
try{tz=Intl.DateTimeFormat().resolvedOptions().timeZone||null;}catch(e){}
|
|
98
|
+
if(!tz){return {mode:null,source:'none',timeZone:null};}
|
|
99
|
+
var slash=tz.indexOf('/');
|
|
100
|
+
var group=slash===-1?'':tz.slice(0,slash);
|
|
101
|
+
var rest=slash===-1?tz:tz.slice(slash+1);
|
|
102
|
+
var zones=Object.prototype.hasOwnProperty.call(cfg.optOut,group)?cfg.optOut[group]:[];
|
|
103
|
+
if(zones.indexOf(rest)>-1){return {mode:'opt-out',source:'timezone',timeZone:tz};}
|
|
104
|
+
return {mode:'opt-in',source:'timezone',timeZone:tz};
|
|
105
|
+
}
|
|
106
|
+
var region=adapter?{mode:cfg.mode,source:'provider',timeZone:null}:(cfg.mode==='auto'?detectRegion():{mode:cfg.mode,source:'config',timeZone:null});
|
|
107
|
+
var mode=region.mode||'opt-in';
|
|
108
|
+
var gpc=navigator.globalPrivacyControl===true;
|
|
109
|
+
var saved=adapter?null:readCookie();
|
|
110
|
+
var state={necessary:true,analytics:mode==='opt-out',marketing:mode==='opt-out'&&!gpc};
|
|
111
|
+
if(saved){state.analytics=!!saved.analytics;state.marketing=!!saved.marketing&&!gpc;}
|
|
112
|
+
var listeners=[];
|
|
113
|
+
function emit(name){
|
|
114
|
+
var snapshot={necessary:true,analytics:state.analytics,marketing:state.marketing};
|
|
115
|
+
for(var i=0;i<listeners.length;i++){if(listeners[i].name===name){try{listeners[i].fn(snapshot);}catch(e){}}}
|
|
116
|
+
}
|
|
117
|
+
function gtagConsent(command){
|
|
118
|
+
if(adapter){return;}
|
|
119
|
+
window[cfg.dataLayer]=window[cfg.dataLayer]||[];
|
|
120
|
+
var a=state.analytics?'granted':'denied';
|
|
121
|
+
var m=state.marketing?'granted':'denied';
|
|
122
|
+
window[cfg.dataLayer].push(makeArgs(['consent',command,{analytics_storage:a,ad_storage:m,ad_user_data:m,ad_personalization:m}]));
|
|
123
|
+
}
|
|
124
|
+
function makeArgs(list){
|
|
125
|
+
return (function(){return arguments;}).apply(null,list);
|
|
126
|
+
}
|
|
127
|
+
function activate(){
|
|
128
|
+
var nodes=document.querySelectorAll('script[type="text/plain"][data-consent]');
|
|
129
|
+
for(var i=0;i<nodes.length;i++){
|
|
130
|
+
var node=nodes[i];
|
|
131
|
+
var category=node.getAttribute('data-consent');
|
|
132
|
+
if(!state[category]||node.getAttribute('data-consent-loaded')){continue;}
|
|
133
|
+
var script=document.createElement('script');
|
|
134
|
+
for(var j=0;j<node.attributes.length;j++){
|
|
135
|
+
var attr=node.attributes[j];
|
|
136
|
+
if(attr.name==='type'||attr.name==='data-consent'||attr.name==='data-consent-type'){continue;}
|
|
137
|
+
script.setAttribute(attr.name,attr.value);
|
|
138
|
+
}
|
|
139
|
+
if(!node.hasAttribute('async')){script.async=false;}
|
|
140
|
+
if(typeof node.nonce==='string'&&node.nonce){script.nonce=node.nonce;}
|
|
141
|
+
var originalType=node.getAttribute('data-consent-type');
|
|
142
|
+
if(originalType){script.setAttribute('type',originalType);}
|
|
143
|
+
if(!node.getAttribute('src')){script.text=node.text;}
|
|
144
|
+
node.setAttribute('data-consent-loaded','true');
|
|
145
|
+
node.parentNode.insertBefore(script,node.nextSibling);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function close(){
|
|
149
|
+
api.dialogOpen=false;
|
|
150
|
+
emit('close');
|
|
151
|
+
}
|
|
152
|
+
function save(next){
|
|
153
|
+
if(adapter){console.warn('Consent is managed by '+cfg.mode+'.');return;}
|
|
154
|
+
var revoked=!!next&&((state.analytics&&next.analytics===false)||(state.marketing&&next.marketing===false));
|
|
155
|
+
if(next&&typeof next.analytics==='boolean'){state.analytics=next.analytics;}
|
|
156
|
+
if(next&&typeof next.marketing==='boolean'){state.marketing=next.marketing&&!gpc;}
|
|
157
|
+
writeCookie(state);
|
|
158
|
+
api.decided=true;
|
|
159
|
+
api.state={necessary:true,analytics:state.analytics,marketing:state.marketing};
|
|
160
|
+
gtagConsent('update');
|
|
161
|
+
activate();
|
|
162
|
+
emit('change');
|
|
163
|
+
close();
|
|
164
|
+
if(revoked){api.reload();}
|
|
165
|
+
}
|
|
166
|
+
function applyProvider(next){
|
|
167
|
+
if(!next){return;}
|
|
168
|
+
var analytics=!!next.analytics;
|
|
169
|
+
var marketing=!!next.marketing&&!gpc;
|
|
170
|
+
var decided=api.decided||!!next.decided;
|
|
171
|
+
var changed=analytics!==state.analytics||marketing!==state.marketing||decided!==api.decided;
|
|
172
|
+
state.analytics=analytics;
|
|
173
|
+
state.marketing=marketing;
|
|
174
|
+
api.decided=decided;
|
|
175
|
+
api.state={necessary:true,analytics:analytics,marketing:marketing};
|
|
176
|
+
activate();
|
|
177
|
+
if(changed){emit('change');}
|
|
178
|
+
}
|
|
179
|
+
function readProvider(){
|
|
180
|
+
applyProvider(adapter.read());
|
|
181
|
+
}
|
|
182
|
+
function listenProvider(){
|
|
183
|
+
adapter.subscribe(readProvider);
|
|
184
|
+
readProvider();
|
|
185
|
+
}
|
|
186
|
+
function startProvider(){
|
|
187
|
+
if(adapter.ready()){listenProvider();return;}
|
|
188
|
+
var waited=0;
|
|
189
|
+
var timer=setInterval(function(){
|
|
190
|
+
if(adapter.ready()){clearInterval(timer);listenProvider();return;}
|
|
191
|
+
waited+=250;
|
|
192
|
+
if(waited>=15000){
|
|
193
|
+
clearInterval(timer);
|
|
194
|
+
console.warn('Consent provider '+cfg.mode+' did not load. Analytics stays off.');
|
|
195
|
+
}
|
|
196
|
+
},250);
|
|
197
|
+
}
|
|
198
|
+
var api={
|
|
199
|
+
configuredMode:cfg.mode,
|
|
200
|
+
mode:mode,
|
|
201
|
+
state:{necessary:true,analytics:state.analytics,marketing:state.marketing},
|
|
202
|
+
decided:!!saved,
|
|
203
|
+
gpc:gpc,
|
|
204
|
+
dialogOpen:false,
|
|
205
|
+
region:{source:region.source,timeZone:region.timeZone},
|
|
206
|
+
accept:function(){save({analytics:true,marketing:true});},
|
|
207
|
+
reject:function(){save({analytics:false,marketing:false});},
|
|
208
|
+
save:save,
|
|
209
|
+
open:function(){
|
|
210
|
+
if(adapter){
|
|
211
|
+
if(!adapter.ready()){console.warn('Consent provider '+cfg.mode+' is not loaded yet.');return;}
|
|
212
|
+
if(adapter.open()===false){console.warn('Consent provider '+cfg.mode+' has no preference center hook. Add your own trigger.');}
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
api.dialogOpen=true;emit('open');
|
|
216
|
+
},
|
|
217
|
+
close:close,
|
|
218
|
+
reload:function(){window.location.reload();},
|
|
219
|
+
on:function(name,fn){
|
|
220
|
+
var entry={name:name,fn:fn};
|
|
221
|
+
listeners.push(entry);
|
|
222
|
+
return function(){var i=listeners.indexOf(entry);if(i>-1){listeners.splice(i,1);}};
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
window.redocly=window.redocly||{};
|
|
226
|
+
window.redocly.consent=api;
|
|
227
|
+
gtagConsent('default');
|
|
228
|
+
if(adapter){startProvider();}
|
|
229
|
+
if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',activate);}else{activate();}
|
|
230
|
+
})();`}export{c as buildConsentScript};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { ConsentConfig } from '@redocly/config';
|
|
3
|
+
export type GatedConsentCategory = 'analytics' | 'marketing';
|
|
4
|
+
export declare function gateSsrComponents(components: JSX.Element[], category: GatedConsentCategory, consent?: ConsentConfig): JSX.Element[];
|
|
5
|
+
//# sourceMappingURL=gate-ssr-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{isConsentEnabled as i}from"./is-consent-enabled.js";function c(r,p,o){return i(o)?r.filter(t=>t.type!=="noscript").map(t=>{if(t.type!=="script")return t;const n=t.props.type;return e.cloneElement(t,{type:"text/plain","data-consent":p,...n?{"data-consent-type":n}:{}})}):r}export{c as gateSsrComponents};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"react";import{buildConsentScript as a}from"./build-consent-script.js";import{isConsentEnabled as s}from"./is-consent-enabled.js";async function d(){return{id:"Consent",async processContent(n){const t=n.getConfig(),e=t?.consent;if(!s(e))return;const o=t?.analytics?.gtm?.dataLayerName||"dataLayer";n.addSsrComponents([r.createElement("script",{key:"redocly-consent",dangerouslySetInnerHTML:{__html:a(e,{dataLayerName:o})}})],"head")}}}export{d as consentPlugin};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConsentConfig } from '@redocly/config';
|
|
2
|
+
export declare const PROVIDER_MODES: readonly ['onetrust', 'cookiebot', 'trustarc', 'tcf'];
|
|
3
|
+
export type ConsentProviderMode = (typeof PROVIDER_MODES)[number];
|
|
4
|
+
export declare function isConsentEnabled(consent?: ConsentConfig): consent is ConsentConfig & {
|
|
5
|
+
mode: 'auto' | 'opt-in' | 'opt-out' | ConsentProviderMode;
|
|
6
|
+
};
|
|
7
|
+
export declare function isProviderMode(mode?: ConsentConfig['mode']): mode is ConsentProviderMode;
|
|
8
|
+
//# sourceMappingURL=is-consent-enabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=["onetrust","cookiebot","trustarc","tcf"];function t(o){return!!o?.mode&&o?.mode!=="none"}function n(o){return e.includes(o)}export{e as PROVIDER_MODES,t as isConsentEnabled,n as isProviderMode};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ZoneMode = 'opt-in' | 'opt-out';
|
|
2
|
+
export declare function resolveZoneMode(zone: string): ZoneMode | undefined;
|
|
3
|
+
export declare function buildZoneModes(): {
|
|
4
|
+
optIn: string[];
|
|
5
|
+
optOut: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function groupZones(zones: string[]): Record<string, string[]>;
|
|
8
|
+
//# sourceMappingURL=zone-modes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{OPT_IN_COUNTRIES as c,TZ_COUNTRIES as s}from"../../constants/plugins/consent.js";function p(e){const t=s[e];if(!(!t||t.length===0))return t.some(o=>c.has(o))?"opt-in":"opt-out"}function f(){const e=[],t=[];for(const o of Object.keys(s)){const n=p(o);n==="opt-in"&&e.push(o),n==="opt-out"&&t.push(o)}return{optIn:e,optOut:t}}function d(e){const t={};for(const o of e){const n=o.indexOf("/"),r=n===-1?"":o.slice(0,n),u=n===-1?o:o.slice(n+1);(t[r]||=[]).push(u)}return t}export{f as buildZoneModes,d as groupZones,p as resolveZoneMode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import B from"@redocly/portal-plugin-mock-server";import{REDOCLY_ROUTE_RBAC as x}from"@redocly/config";import{combineUrls as E,withPathPrefix as L}from"@redocly/theme/core/utils";import{VERSION_SEPARATOR as k}from"../constants/common.js";import{removeTrailingSlash as N}from"../../utils/url/remove-trailing-slash.js";import{removeLeadingSlash as j}from"../../utils/url/remove-leading-slash.js";import{isTruthy as $}from"../../utils/guards/is-truthy.js";import{normalizeRouteSlug as D}from"../../utils/path/normalize-route-slug.js";import{parsePathVersions as V}from"../../utils/path/parse-path-versions.js";import{reporter as v}from"../tools/notifiers/reporter.js";import{logger as P}from"../tools/notifiers/logger.js";import{envConfig as S}from"../config/env-config.js";import{shaDirPathShort as M}from"../utils/crypto/sha-dir-path-short.js";import{writeServerRebuildTrigger as _,generateBrowserPluginsModule as q,generateClientRoutes as z,generateTemplatesModule as H}from"../esbuild/generate.js";import{customPagesPlugin as U}from"../../server/plugins/pages/index.js";import{apiDocsPlugin as G}from"../../server/plugins/api-docs/index.js";import{configParserPlugin as I}from"./config-parser/index.js";import{createSlugify as W}from"./create-slugify.js";import{markdownPlugin as K}from"./markdown/index.js";import{searchPlugin as Y}from"./search/index.js";import{skillsPlugin as J}from"./skills/index.js";import{defaultThemePlugin as Q}from"./default-theme/index.js";import{apiKeyMgmtPlugin as X}from"./dev-onboarding/index.js";import{apiFunctionsPlugin as Z}from"./api-functions/index.js";import{scorecardClassicPlugin as ee}from"./scorecard-classic/index.js";import{lintPlugin as te}from"./lint/index.js";import{resolveExternalPlugins as oe}from"../external-plugins/resolve-external-plugins.js";import{sidebarsPlugin as ie}from"./sidebars/index.js";import{l10nPlugin as re}from"./l10n/index.js";import{validateRedirects as ne}from"../utils/redirects/validate-redirects.js";import{analyticsPlugins as se}from"./analytics/index.js";import{
|
|
2
|
-
`+l.stack;
|
|
1
|
+
import B from"@redocly/portal-plugin-mock-server";import{REDOCLY_ROUTE_RBAC as x}from"@redocly/config";import{combineUrls as E,withPathPrefix as L}from"@redocly/theme/core/utils";import{VERSION_SEPARATOR as k}from"../constants/common.js";import{removeTrailingSlash as N}from"../../utils/url/remove-trailing-slash.js";import{removeLeadingSlash as j}from"../../utils/url/remove-leading-slash.js";import{isTruthy as $}from"../../utils/guards/is-truthy.js";import{normalizeRouteSlug as D}from"../../utils/path/normalize-route-slug.js";import{parsePathVersions as V}from"../../utils/path/parse-path-versions.js";import{reporter as v}from"../tools/notifiers/reporter.js";import{logger as P}from"../tools/notifiers/logger.js";import{envConfig as S}from"../config/env-config.js";import{shaDirPathShort as M}from"../utils/crypto/sha-dir-path-short.js";import{writeServerRebuildTrigger as _,generateBrowserPluginsModule as q,generateClientRoutes as z,generateTemplatesModule as H}from"../esbuild/generate.js";import{customPagesPlugin as U}from"../../server/plugins/pages/index.js";import{apiDocsPlugin as G}from"../../server/plugins/api-docs/index.js";import{configParserPlugin as I}from"./config-parser/index.js";import{createSlugify as W}from"./create-slugify.js";import{markdownPlugin as K}from"./markdown/index.js";import{searchPlugin as Y}from"./search/index.js";import{skillsPlugin as J}from"./skills/index.js";import{defaultThemePlugin as Q}from"./default-theme/index.js";import{apiKeyMgmtPlugin as X}from"./dev-onboarding/index.js";import{apiFunctionsPlugin as Z}from"./api-functions/index.js";import{scorecardClassicPlugin as ee}from"./scorecard-classic/index.js";import{lintPlugin as te}from"./lint/index.js";import{resolveExternalPlugins as oe}from"../external-plugins/resolve-external-plugins.js";import{sidebarsPlugin as ie}from"./sidebars/index.js";import{l10nPlugin as re}from"./l10n/index.js";import{validateRedirects as ne}from"../utils/redirects/validate-redirects.js";import{analyticsPlugins as se}from"./analytics/index.js";import{consentPlugin as ae}from"./consent/index.js";import{sitemapPlugin as le}from"./sitemap/index.js";import{entitlementsPlugin as ce}from"./entitlements/index.js";import{getBilledPagesCount as ue}from"../utils/index.js";import{telemetry as fe}from"../../cli/telemetry/index.js";import{telemetryTraceStep as b}from"../../cli/telemetry/helpers/trace-step.js";import{EntitlementsProvider as A}from"../entitlements/entitlements-provider.js";import{enforceLoginPlugin as me}from"./enforce-login/index.js";import{ssoPlugin as de}from"./sso/index.js";import{Cache as ge}from"../fs/cache.js";import{ContentFs as pe}from"../fs/content-fs.js";import{findProductBySlug as Pe}from"../utils/product.js";import{isRouteReserved as ye}from"./get-reserved-routes.js";import{catalogClassicPlugin as he}from"./catalog-classic/index.js";import{arazzoDocsPlugin as Re}from"./arazzo-docs/index.js";const Ce=[I,me,de,Q,re,K,G,Re,ee,te,Z,U,X,he,{importPath:"./catalog-entities/plugin.js",loadCondition:()=>S.NEW_CATALOG_ENABLED??!1},{importPath:"./scorecards/plugin.js",loadCondition:()=>S.NEW_SCORECARDS_ENABLED??!1},{importPath:"./mcp/index.js",loadCondition:()=>A.instance().canAccessFeature("mcp")},ie,le,ce,Y,J,B,ae,...se];async function Pt(t,e=Ce){return await b("com.redocly.build.pluginsInit",async()=>{const r=[],R=A.instance(),y={};for(const s of e){let u;if("loadCondition"in s){if(!s.loadCondition())continue;const i=await import(s.importPath);if(!i.default||typeof i.default!="function"){await v.panicOnBuild(`Dynamic plugin ${s.importPath} does not export a default export or it is not a function`);continue}u=i.default}else u=s;const h=await u(t);for(const[i,f]of Object.entries(h.loaders||{}))y[i]&&await v.panicOnBuild(`Duplicate loader with name ${i}`),y[i]=f;(!h.requiredEntitlements||h.requiredEntitlements?.every(i=>R.canAccessFeature(i)))&&r.push(h)}const l=new pe(t.contentDir);await l.ready;const c=new ge(l);return c.setLoaders(y),P.verbose("All plugins instantiated"),{pluginInstances:r,lifecycleContext:be(l,c)}})}function O(t){P.verbose("Generating templates"),b("com.redocly.build.writeClientEntries",()=>{H(t),q(t),z(t)})}async function ve(t){const e=t.getAllRoutes();ue(e)||await v.panicOnBuild("No routes created by plugins. Please check your project configuration.")}async function yt(t,e,r,R={}){const y=A.instance();try{await b("com.redocly.build.pluginsRun",async()=>{e.startPluginsRun();const l=S.isDevelopMode&&e.buildRevision>0,c=l?F(e):"";let s=[];await b("com.redocly.build.pluginsProcessContent",async i=>{for(const o of t){const a=P.startTiming();await o.processContent?.(e,r),P.verboseTime(a,`processContent for ${o.id}`)}s=(await oe(e.contentDir,e.config.plugins)).map(o=>o.lifecyclePlugin).filter(o=>$(o)&&(!o.requiredEntitlements||o.requiredEntitlements?.every(a=>y.canAccessFeature(a)))),r.cache.setLoaders(Object.fromEntries(s.flatMap(o=>Object.entries(o.loaders||{}))));for(const o of s){const a=P.startTiming();await o.processContent?.(e,r),P.verboseTime(a,`processContent for ${o.id}`)}i?.setAttribute("externalPluginsProcessed",s.length.toString())});const u=await we(e,r),h=[...t,...s];O(e),S.isDevelopMode?await e.userCodeReady:e.buildRevision++,await b("com.redocly.build.pluginsAfterRoutesCreated",async()=>{for(const i of h){const f=P.startTiming();await i.afterRoutesCreated?.(e,u),P.verboseTime(f,`afterRoutesCreated for ${i.id}`)}}),ne(e),await e.reportUnsetEnvVars(),await ve(e),O(e),l&&c!==F(e)&&(e.markRequestHandlersEntryOutdated(),_(e.serverOutDir))})}catch(l){const c="Unhandled error in plugin. "+l.message+`
|
|
2
|
+
`+l.stack;fe.sendCliErrorCaughtMessage([{id:"cli",object:"error",uri:"urn:redocly:realm:cli:error:cli",message:c}]),R.failFast?await v.panic(c):await v.panicOnBuild(c)}finally{e.finishPluginsRun()}}async function we(t,e){const{cache:r,fs:R}=e,y=await e.getConfig(),l=Object.values(y.products||{}),c=(await r.load("versions-config","versions-config")).data,s=(await r.load("content-slugs","content-slugs")).data,u=W(s);for(const{duplicateInAllLocales:i,slugSuffix:f,sharedData:o=[],redirectFrom:a=[],...d}of t.newRoutes){const w=D(d.slug?d.slug:u(d.fsPath)),g=N(f?E(w,f):w),n={...d,[x]:{slug:g,fsPath:d.fsPath},slug:g,baseSlug:w,versions:h(d.fsPath,f),product:Pe(l,g,u)};ye(g,y)&&await v.panicOnBuildContentError(`Route "${g}" is reserved and cannot be used. Please choose a different slug for "${d.fsPath}".`),t.routesByFsPath.set(n.fsPath,n.slug),t.routesBySlug.set(n.slug,n);for(const{key:p,id:m}of o)t.addRouteSharedData(n.slug,p,m);for(const p of a)t.addRedirect(p.from,{type:p.type,to:n.slug});if(i)for(const p of R.localeFolders){const m={...n,slug:"/"+p.toLowerCase()+n.slug};t.routesByFsPath.set(m.fsPath,m.slug),t.routesBySlug.set(m.slug,m);for(const{key:C,id:T}of o)t.addRouteSharedData(m.slug,C,T);for(const C of a){const T=E(R.localizationFolder,p,C.from);t.addRedirect(T,{type:C.type,to:m.slug},{trackOriginalSource:!1})}}}return t.newRoutes=[],{...e,slugify:u};function h(i,f=""){const o=V(i);if(!o?.versionName)return;const{versionFolderPath:a,filePathInVersion:d,versionName:w}=o,g=c.get(a);if(g)return g.versions.map(n=>{const p=g.defaultVersion===n.version,m=j(E(a,k+n.version,d)),C=u(m);return{version:n.version,label:n.name||n.version,link:D(E(C,f)),default:p,active:w===n.version,folderId:M(`${a}`)}})}}function be(t,e){return{fs:t,cache:e,getConfig:async(r=".")=>(await e.load(r,"nearest-redocly-config",t.localeFolders)).data,isPathIgnored:async r=>(await e.load(r,"is-ignored")).data,withPathPrefix:L,logger:P}}function F(t){return[...t.apiRoutesRequestHandlers.keys(),...t.getMcpTools().map(e=>`${e.name}:${e.importPath}`)].sort().join(",")}export{Ce as INTERNAL_PLUGINS,be as createLifecycleContext,Pt as initPlugins,yt as runPlugins,O as writeClientEntries};
|
|
@@ -4,6 +4,8 @@ export declare function getMarkdocOptions(serverOutDir?: string, _templateId?: s
|
|
|
4
4
|
heading: import("@markdoc/markdoc").Schema;
|
|
5
5
|
fence: import("@markdoc/markdoc").Schema;
|
|
6
6
|
table: import("@markdoc/markdoc").Schema;
|
|
7
|
+
td: import("@markdoc/markdoc").Schema;
|
|
8
|
+
th: import("@markdoc/markdoc").Schema;
|
|
7
9
|
text: import("@markdoc/markdoc").Schema;
|
|
8
10
|
strong: {
|
|
9
11
|
render?: string | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
${
|
|
3
|
-
`:"";let s=[];for(const t of o)if(t instanceof
|
|
4
|
-
`)};(t.attributes.level>1||
|
|
5
|
-
`:"",
|
|
6
|
-
`)});else{const a=t.parentNode?.id??
|
|
7
|
-
`:"",m.content+=t.content.trimEnd(),c.set(a,m)}const
|
|
8
|
-
`),fsPath:n.fsPath,locale:u,product:n.product?.name,facets:f}))}function
|
|
9
|
-
`+i.content:(o.push(e),e=i)}return o.push(e),o}function
|
|
1
|
+
import M from"@markdoc/markdoc";import D from"node:path";import{AI_SEARCH_CHUNK_SIZE as R,AI_SEARCH_DOCUMENT_CHUNK_SIZE as v}from"../../../constants/plugins/search.js";import{slugger as I}from"../../../../utils/slugger.js";import{joinSectionContent as N}from"./join-section-content.js";import{toMarkdown as P}from"./to-markdown.js";import{AstToSearchNodeTransformer as w}from"./walk-sections.js";import{createRenderTagFn as x}from"./create-render-tag-fn.js";import{getBuildTranslateContext as K}from"../../../utils/l10n/get-build-translate-context.js";import{getLocaleFromRelativePath as L}from"../../../fs/utils/get-locale-from-relative-path.js";import{HeadingNode as b}from"./nodes/heading-node.js";import{extractDocumentSearchFacets as U}from"./search-facets.js";import{formatDocumentMetadata as y}from"../../search/utils.js";import{TagNode as H}from"./nodes/tag-node.js";import{MARKDOC_PARTIALS_DATA_KEY as O}from"../../../constants/common.js";const j=Symbol(),at=(n,o)=>async(e,r,i,c)=>{if(o?.excludeFromSearch)return;I.reset();const l=await e.getNavText?.()||D.basename(e.fsPath),f=M.Ast.fromJSON(r.ast),{locale:g,translate:A}=await K(e.slug,c.getGlobalData?.().l10n),s=new w({partials:c.getGlobalConfig(O)||{},renderTag:x(c.markdocOptions.tags,g,A),getInnerContent:P,ast:f,skipConditionals:!0}),d=Array.from(s.transform());return{async getLLMsTxts(){const u=o?.seo,t=u&&typeof u=="object"&&"description"in u?String(u.description):void 0,a=N(d);return[{title:l,description:t,slug:e.slug,fsPath:e.fsPath,content:a,includeInLLMsTxt:!0}]},async getSearchDocuments(){return F(e,d,n,l)}}};function F(n,o,e,r){const i=n.slug,c=new Map,l=n.metadata||{},f=U(l,e),g=y(l),A=g?`Metadata:
|
|
2
|
+
${g}
|
|
3
|
+
`:"";let s=[];for(const t of o)if(t instanceof b){s.splice(t.attributes.level-1,6);const a=t.attributes.level>2,m=s[s.length-1]?.title,T=s[s.length-1]?.url,C=a&&m?m:W(r,t),S=a&&T?T:t.getUrl(i),p={title:C,content:"",url:S,level:t.attributes.level,toc:s.map(E=>h(E.section)).join(`
|
|
4
|
+
`)};(t.attributes.level>1||h(t)!==r)&&(p.content+=p.content?`
|
|
5
|
+
`:"",p.content+=t.content.trimEnd()),c.set(t.id,p),s.push({section:t,title:C,url:S})}else if(t instanceof H)c.set(t.id,{title:t.content,content:t.content,url:t.getUrl(i),level:t.attributes.level+1,toc:s.map(a=>h(a.section)).concat(t.content).join(`
|
|
6
|
+
`)});else{const a=t.parentNode?.id??j,m=c.get(a)??{title:r,content:"",url:i,level:1/0,toc:""};m.content+=m.content?`
|
|
7
|
+
`:"",m.content+=t.content.trimEnd(),c.set(a,m)}const d=$(Array.from(c.values())),u=L(n.fsPath);return d.filter(t=>t.content).map(t=>({title:t.title,url:t.url,content:[A,t.toc||`# ${r}`,t.content].filter(Boolean).join(`
|
|
8
|
+
`),fsPath:n.fsPath,locale:u,product:n.product?.name,facets:f}))}function _(n){return n.length/4}function $(n){if(n.length===0)return[];const o=[];let e=n[0];for(let r=1;r<n.length;r++){const i=n[r],c=_(e.content),l=_(i.content),f=r===n.length-1;l<R&&(c<v||f)&&i.level>e.level?e.content+=`
|
|
9
|
+
`+i.content:(o.push(e),e=i)}return o.push(e),o}const k=String.raw`\((?:[^()]|\([^()]*\))*\)`,G=new RegExp(String.raw`!\[[^\]]*\]`+k,"g"),z=new RegExp(String.raw`\[([^\]]*)\]`+k,"g");function W(n,o){const e=h(o);return o.content===n||!e?n:`${n} \u2192 ${e}`}function h(n){return B(n.content.replace(/^#+/,""))}function B(n){return n.replace(G,"").replace(z,"$1").trim()}export{at as getAiDocumentsStore};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SectionNode, type SectionNodeParams } from './section-node.js';
|
|
2
|
-
export declare const TAG_TITLE_ATTRIBUTES: readonly ['title', '
|
|
2
|
+
export declare const TAG_TITLE_ATTRIBUTES: readonly ['title', 'name', 'label'];
|
|
3
3
|
declare const TagNode_base: typeof SectionNode;
|
|
4
4
|
export declare class TagNode extends TagNode_base {
|
|
5
5
|
constructor(params: SectionNodeParams);
|