@redocly/openapi-docs 3.22.0-next.6 → 3.22.1

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.
@@ -1 +1 @@
1
- import{dirname as b}from"path";import m from"url-template";import{deleteEmptyArrayItem as S,isArrayOfObjects as w,isNumeric as E,removeQueryStringAndHash as T,resolveUrl as N,sanitizeItemId as l,normalizeText as j,getValueFromMdParsedExtension as $,isAbsoluteUrl as z}from"./helpers.js";import{DEFAULT_TAG_SLUG as D,MediaTypes as a}from"../constants.js";import{JsonPointer as _}from"./JsonPointer.js";import{joinWithSeparator as P}from"../services/index.js";import{objectToHarParams as R}from"../services/index.js";import{tryDecodeURIComponent as q}from"./string.js";import{getUrlDirname as U}from"./url.js";import{IS_BROWSER as L}from"./dom.js";function I(e){return typeof e=="string"&&/\dxx/i.test(e)}function ae(e){return e==="default"||E(e)||I(e)}function ce(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(I(e)&&(t*=100),t<100||t>599)throw new Error("invalid HTTP code");let n="success";return t>=300&&t<400?n="redirect":t>=400?n="error":t<200&&(n="info"),n}const F={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0,"x-query":!0,query:!0};function pe(e){return e in F}function fe(e){const{operationId:r,pathName:t}=e,n=j($(e,"description"));return j($(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function me(e,r){return r?.id?P(r.id,l(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?l(e.operationId?e.operationId:d(e.pointer)):l(e.operationId?P(D,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const O={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",contentEncoding:"string",contentMediaType:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",unevaluatedProperties:"object",patternProperties:"object",properties:"object"};function le(e){if(e.type!==void 0&&!Array.isArray(e.type))return e.type;const r=Object.keys(O);for(const t of r){const n=O[t];if(e[t]!==void 0)return n}return"any"}function k(e,r=e.type){if(e["x-circular-ref"]||e["x-complex"])return!0;if(e.oneOf!==void 0||e.anyOf!==void 0||e.if&&e.then||e.if&&e.else)return!1;let t=!0;const n=Array.isArray(r);return(r==="object"||n&&r?.includes("object"))&&(t=e.properties!==void 0?Object.keys(e.properties).length===0:e.additionalProperties===void 0&&e.unevaluatedProperties===void 0&&e.patternProperties===void 0),Array.isArray(e.items)||Array.isArray(e.prefixItems)?!1:(e.items!==void 0&&typeof e.items!="boolean"&&(r==="array"||n&&r?.includes("array"))&&(t=k(e.items,e.items.type)),t)}function W(e){return e.search(/json/i)!==-1}function de(e){return e?.search(/xml/i)!==-1}function C(e){return e===a.URL_ENCODED}function xe(e){return e===a.MULTIPART}function ye(e){return[a.JSONL,a.NDJSON,a.JSON_SEQ,a.EVENT_STREAM,a.MULTIPART_MIXED].includes(e)}function p(e,r,t){return Array.isArray(e)?e.map(n=>n.toString()).join(t):typeof e=="object"?Object.keys(e).map(n=>`${n}${t}${e[n]}`).join(t):r+"="+e.toString()}function M(e,r){return Array.isArray(e)?(console.warn("deepObject style cannot be used with array value:"+e.toString()),""):typeof e=="object"?Object.keys(e).map(t=>e[t]?`${r}[${t}]=${e[t]}`:void 0).filter(Boolean).join("&"):(console.warn("deepObject style cannot be used with non-object value:"+e.toString()),"")}function c(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return m.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function h(e,r){const t=e?"*":"",n="__redoc_param_name__",i=m.parse(`{${n}${t}}`);return q(i.expand({[n]:r}))}function ge(e,r={}){if(Array.isArray(e))throw new Error("Payload must have fields: "+e.toString());return Object.keys(e).map(t=>{const n=e[t],{style:i="form",explode:o=!0}=r[t]||{};switch(i){case"form":return c(t,o,n);case"spaceDelimited":return p(n,t,"%20");case"pipeDelimited":return p(n,t,"|");case"deepObject":return M(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function H(e,r,t,n){const i=t?"*":"";let o="";r==="label"?o=".":r==="matrix"&&(o=";");const s="__redoc_param_name__";return m.parse(`{${o}${s}${i}}`).expand({[s]:n}).replace(/__redoc_param_name__/g,e)}function J(e,r,t,n){const i=o=>{switch(r){case"form":return c(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"|");case"deepObject":return!t||Array.isArray(o)||typeof o!="object"?(console.warn("The style deepObject is only applicable for objects with explode=true"),""):M(o,e);case"simple":return h(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return w(n)&&(n=S(n).map(o=>i(o))),i(n)}function B(e,r,t){switch(e){case"simple":return h(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function G(e,r,t,n){switch(r){case"form":return c(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function x(e,r){return W(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function Q(e,r,t){return C(r)&&typeof e=="object"&&e!==null?R(e).map(n=>`${encodeURIComponent(n.name)}=${encodeURIComponent(n.value||"")}`).join("&"):`${t}=${x(e,r)}`}function be(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return x(r,o);case"cookie":case"query":return`${t}=${x(r,o)}`;case"querystring":return Q(r,o,t);default:return console.warn("Unexpected parameter location: "+e.in),""}if(!n)return console.warn(`Missing style attribute or content for parameter ${t}`),"";switch(e.in){case"path":return H(t,n,i,r);case"query":case"querystring":return J(t,n,i,r);case"header":return B(n,i,r);case"cookie":return G(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function je(e){return e.search(/xml/i)!==-1?"xml":e.includes("application/json-seq")?"json-seq":e.includes("application/jsonl")?"jsonl":e.includes("json")?"json":e.includes("multipart/mixed")?"multipart-mixed":e.includes("text/event-stream")?"yaml":"clike"}const A=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function $e(e){return A.test(e||"")}function _e(e){return e?.match(A)?.pop()}function X(e){if(e===void 0)return;const r=e.toString(10);return/^0\.0*1$/.test(r)?`decimal places <= ${r.split(".")[1].length}`:`multiple of ${r}`}function y(e,r,t){let n;return r!==void 0&&t!==void 0?r===t?n=`= ${r} ${e}`:n=`[ ${r} .. ${t} ] ${e}`:t!==void 0?n=`<= ${t} ${e}`:r!==void 0&&(r===1?n="non-empty":n=`>= ${r} ${e}`),n}function K(e){const r=typeof e.exclusiveMinimum=="number"?Math.min(e.exclusiveMinimum,e.minimum??1/0):e.minimum,t=typeof e.exclusiveMaximum=="number"?Math.max(e.exclusiveMaximum,e.maximum??-1/0):e.maximum,n=typeof e.exclusiveMinimum=="number"||e.exclusiveMinimum,i=typeof e.exclusiveMaximum=="number"||e.exclusiveMaximum;if(r!==void 0&&t!==void 0)return`${n?"( ":"[ "}${r} .. ${t}${i?" )":" ]"}`;if(t!==void 0)return`${i?"< ":"<= "}${t}`;if(r!==void 0)return`${n?"> ":">= "}${r}`}function Pe(e){const r=[],t=y("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=y("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=y(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=X(e.multipleOf);o!==void 0&&r.push(o);const s=K(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function Ie(e,r=[]){const t=[],n=[],i=[];return e.forEach(o=>{o.required?r.includes(o.name)?n.push(o):i.push(o):t.push(o)}),n.sort((o,s)=>r.indexOf(o.name)-r.indexOf(s.name)),[...n,...i,...t]}function Oe(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function Me(e,r=[],t=[],{pathPointer:n,operationPointer:i}){const o={};t.forEach(u=>{({resolved:u}=e.deref(u)),o[u.name+"_"+u.in]=!0});const s=r.map((u,f)=>({paramOrRef:u,pointer:_.join(n,["parameters",String(f)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),g=t.map((u,f)=>({paramOrRef:u,pointer:_.join(i,["parameters",String(f)])}));return[...s,...g]}function he(e,r){const n=e===void 0?T((()=>{if(!L)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?b(i):i})()):z(e)?U(e):b(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?N(n,i.url):i.url,description:i.description||""}))}const Ae=e=>({delete:"del",options:"opts"})[e]||e;function Y(e){return e in{"x-circular-ref":!0,"x-complex":!0,"x-parentRefs":!0,"x-refsStack":!0,"x-codeSamples":!0,"x-displayName":!0,"x-examples":!0,"x-logo":!0,"x-nullable":!0,"x-servers":!0,"x-tagGroups":!0,"x-traitTag":!0,"x-additionalPropertiesName":!0,"x-explicitMappingOnly":!0,"x-enumDescriptions":!0,"x-badges":!0,"x-hideReplay":!0,"x-feedback":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function Se(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Y(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function we(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Ee(e,r){const{resolved:t}=e.deref(r.content);return Z({...r,content:t})}function Z(e){let r=e.content;const t=e["x-examples"],n=e["x-example"];if(t){r={...r};for(const i of Object.keys(t)){const o=t[i];r[i]={...r[i],examples:o}}}else if(n){r={...r};for(const i of Object.keys(n)){const o=n[i];r[i]={...r[i],example:o}}}return r}export{le as detectType,Se as extractExtensions,Ee as getContent,Z as getContentWithLegacyExamples,_e as getDefinitionName,me as getOperationId,fe as getOperationName,ce as getStatusCodeType,Pe as humanizeConstraints,K as humanizeNumberRange,C as isFormUrlEncoded,W as isJsonLike,xe as isMultipartFormData,$e as isNamedDefinition,pe as isOperationName,k as isPrimitiveType,Y as isRedocExtension,ye as isSequentialMediaType,ae as isStatusCode,de as isXmlLike,je as langFromMime,Me as mergeParams,he as normalizeServers,we as pluralizeType,be as serializeParameterValue,x as serializeParameterValueWithMime,J as serializeQueryParameter,Q as serializeQueryStringParameterValueWithMime,Ae as shortenHTTPVerb,Oe as sortByDeprecated,Ie as sortByRequired,ge as urlFormEncodePayload};
1
+ import{dirname as b}from"path";import m from"url-template";import{deleteEmptyArrayItem as S,isArrayOfObjects as w,isNumeric as E,removeQueryStringAndHash as T,resolveUrl as N,sanitizeItemId as l,normalizeText as j,getValueFromMdParsedExtension as $,isAbsoluteUrl as z}from"./helpers.js";import{DEFAULT_TAG_SLUG as D,MediaTypes as a}from"../constants.js";import{JsonPointer as _}from"./JsonPointer.js";import{joinWithSeparator as P}from"../services/index.js";import{objectToHarParams as R}from"../services/index.js";import{tryDecodeURIComponent as q}from"./string.js";import{getUrlDirname as U}from"./url.js";import{IS_BROWSER as L}from"./dom.js";function I(e){return typeof e=="string"&&/\dxx/i.test(e)}function ae(e){return e==="default"||E(e)||I(e)}function ce(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(I(e)&&(t*=100),t<100||t>599)throw new Error("invalid HTTP code");let n="success";return t>=300&&t<400?n="redirect":t>=400?n="error":t<200&&(n="info"),n}const F={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0,"x-query":!0,query:!0};function pe(e){return e in F}function fe(e){const{operationId:r,pathName:t}=e,n=j($(e,"description"));return j($(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function me(e,r){return r?.id?P(r.id,l(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?l(e.operationId?e.operationId:d(e.pointer)):l(e.operationId?P(D,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const O={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",contentEncoding:"string",contentMediaType:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",unevaluatedProperties:"object",patternProperties:"object",properties:"object"};function le(e){if(e.type!==void 0&&!Array.isArray(e.type))return e.type;const r=Object.keys(O);for(const t of r){const n=O[t];if(e[t]!==void 0)return n}return"any"}function k(e,r=e.type){if(e["x-circular-ref"]||e["x-complex"])return!0;if(e.oneOf!==void 0||e.anyOf!==void 0||e.if&&e.then||e.if&&e.else)return!1;let t=!0;const n=Array.isArray(r);return(r==="object"||n&&r?.includes("object"))&&(t=e.properties!==void 0?Object.keys(e.properties).length===0:e.additionalProperties===void 0&&e.unevaluatedProperties===void 0&&e.patternProperties===void 0),Array.isArray(e.items)||Array.isArray(e.prefixItems)?!1:(e.items!==void 0&&typeof e.items!="boolean"&&(r==="array"||n&&r?.includes("array"))&&(t=k(e.items,e.items.type)),t)}function W(e){return e.search(/json/i)!==-1}function de(e){return e?.search(/xml/i)!==-1}function C(e){return e===a.URL_ENCODED}function xe(e){return e===a.MULTIPART}function ye(e){return[a.JSONL,a.NDJSON,a.JSON_SEQ,a.EVENT_STREAM,a.MULTIPART_MIXED].includes(e)}function p(e,r,t){return Array.isArray(e)?e.map(n=>n.toString()).join(t):typeof e=="object"?Object.keys(e).map(n=>`${n}${t}${e[n]}`).join(t):r+"="+e.toString()}function M(e,r){return Array.isArray(e)?(console.warn("deepObject style cannot be used with array value:"+e.toString()),""):typeof e=="object"?Object.keys(e).map(t=>e[t]?`${r}[${t}]=${e[t]}`:void 0).filter(Boolean).join("&"):(console.warn("deepObject style cannot be used with non-object value:"+e.toString()),"")}function c(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return m.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function h(e,r){const t=e?"*":"",n="__redoc_param_name__",i=m.parse(`{${n}${t}}`);return q(i.expand({[n]:r}))}function ge(e,r={}){if(Array.isArray(e))throw new Error("Payload must have fields: "+e.toString());return Object.keys(e).map(t=>{const n=e[t],{style:i="form",explode:o=!0}=r[t]||{};switch(i){case"form":return c(t,o,n);case"spaceDelimited":return p(n,t,"%20");case"pipeDelimited":return p(n,t,"|");case"deepObject":return M(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function H(e,r,t,n){const i=t?"*":"";let o="";r==="label"?o=".":r==="matrix"&&(o=";");const s="__redoc_param_name__";return m.parse(`{${o}${s}${i}}`).expand({[s]:n}).replace(/__redoc_param_name__/g,e)}function J(e,r,t,n){const i=o=>{switch(r){case"form":return c(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?c(e,t,o):p(n,e,"|");case"deepObject":return!t||Array.isArray(o)||typeof o!="object"?(console.warn("The style deepObject is only applicable for objects with explode=true"),""):M(o,e);case"simple":return h(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return w(n)&&(n=S(n).map(o=>i(o))),i(n)}function B(e,r,t){return e==="simple"?h(r,t):(console.warn("Unexpected style for header: "+e),"")}function G(e,r,t,n){return r==="form"?c(e,t,n):(console.warn("Unexpected style for cookie: "+r),"")}function x(e,r){return W(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function Q(e,r,t){return C(r)&&typeof e=="object"&&e!==null?R(e).map(n=>`${encodeURIComponent(n.name)}=${encodeURIComponent(n.value||"")}`).join("&"):`${t}=${x(e,r)}`}function be(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return x(r,o);case"cookie":case"query":return`${t}=${x(r,o)}`;case"querystring":return Q(r,o,t);default:return console.warn("Unexpected parameter location: "+e.in),""}if(!n)return console.warn(`Missing style attribute or content for parameter ${t}`),"";switch(e.in){case"path":return H(t,n,i,r);case"query":case"querystring":return J(t,n,i,r);case"header":return B(n,i,r);case"cookie":return G(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function je(e){return e.search(/xml/i)!==-1?"xml":e.includes("application/json-seq")?"json-seq":e.includes("application/jsonl")?"jsonl":e.includes("json")?"json":e.includes("multipart/mixed")?"multipart-mixed":e.includes("text/event-stream")?"yaml":"clike"}const A=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function $e(e){return A.test(e||"")}function _e(e){return e?.match(A)?.pop()}function X(e){if(e===void 0)return;const r=e.toString(10);return/^0\.0*1$/.test(r)?`decimal places <= ${r.split(".")[1].length}`:`multiple of ${r}`}function y(e,r,t){let n;return r!==void 0&&t!==void 0?r===t?n=`= ${r} ${e}`:n=`[ ${r} .. ${t} ] ${e}`:t!==void 0?n=`<= ${t} ${e}`:r!==void 0&&(r===1?n="non-empty":n=`>= ${r} ${e}`),n}function K(e){const r=typeof e.exclusiveMinimum=="number"?Math.min(e.exclusiveMinimum,e.minimum??1/0):e.minimum,t=typeof e.exclusiveMaximum=="number"?Math.max(e.exclusiveMaximum,e.maximum??-1/0):e.maximum,n=typeof e.exclusiveMinimum=="number"||e.exclusiveMinimum,i=typeof e.exclusiveMaximum=="number"||e.exclusiveMaximum;if(r!==void 0&&t!==void 0)return`${n?"( ":"[ "}${r} .. ${t}${i?" )":" ]"}`;if(t!==void 0)return`${i?"< ":"<= "}${t}`;if(r!==void 0)return`${n?"> ":">= "}${r}`}function Pe(e){const r=[],t=y("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=y("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=y(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=X(e.multipleOf);o!==void 0&&r.push(o);const s=K(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function Ie(e,r=[]){const t=[],n=[],i=[];return e.forEach(o=>{o.required?r.includes(o.name)?n.push(o):i.push(o):t.push(o)}),n.sort((o,s)=>r.indexOf(o.name)-r.indexOf(s.name)),[...n,...i,...t]}function Oe(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function Me(e,r=[],t=[],{pathPointer:n,operationPointer:i}){const o={};t.forEach(u=>{({resolved:u}=e.deref(u)),o[u.name+"_"+u.in]=!0});const s=r.map((u,f)=>({paramOrRef:u,pointer:_.join(n,["parameters",String(f)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),g=t.map((u,f)=>({paramOrRef:u,pointer:_.join(i,["parameters",String(f)])}));return[...s,...g]}function he(e,r){const n=e===void 0?T((()=>{if(!L)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?b(i):i})()):z(e)?U(e):b(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?N(n,i.url):i.url,description:i.description||""}))}const Ae=e=>({delete:"del",options:"opts"})[e]||e;function Y(e){return e in{"x-circular-ref":!0,"x-complex":!0,"x-parentRefs":!0,"x-refsStack":!0,"x-codeSamples":!0,"x-displayName":!0,"x-examples":!0,"x-logo":!0,"x-nullable":!0,"x-servers":!0,"x-tagGroups":!0,"x-traitTag":!0,"x-additionalPropertiesName":!0,"x-explicitMappingOnly":!0,"x-enumDescriptions":!0,"x-badges":!0,"x-hideReplay":!0,"x-feedback":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function Se(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Y(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function we(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Ee(e,r){const{resolved:t}=e.deref(r.content);return Z({...r,content:t})}function Z(e){let r=e.content;const t=e["x-examples"],n=e["x-example"];if(t){r={...r};for(const i of Object.keys(t)){const o=t[i];r[i]={...r[i],examples:o}}}else if(n){r={...r};for(const i of Object.keys(n)){const o=n[i];r[i]={...r[i],example:o}}}return r}export{le as detectType,Se as extractExtensions,Ee as getContent,Z as getContentWithLegacyExamples,_e as getDefinitionName,me as getOperationId,fe as getOperationName,ce as getStatusCodeType,Pe as humanizeConstraints,K as humanizeNumberRange,C as isFormUrlEncoded,W as isJsonLike,xe as isMultipartFormData,$e as isNamedDefinition,pe as isOperationName,k as isPrimitiveType,Y as isRedocExtension,ye as isSequentialMediaType,ae as isStatusCode,de as isXmlLike,je as langFromMime,Me as mergeParams,he as normalizeServers,we as pluralizeType,be as serializeParameterValue,x as serializeParameterValueWithMime,J as serializeQueryParameter,Q as serializeQueryStringParameterValueWithMime,Ae as shortenHTTPVerb,Oe as sortByDeprecated,Ie as sortByRequired,ge as urlFormEncodePayload};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.22.0-next.6",
3
+ "version": "3.22.1",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -24,7 +24,7 @@
24
24
  "@markdoc/markdoc": "0.5.2",
25
25
  "@redocly/openapi-core": "2.31.6",
26
26
  "deepmerge": "^4.2.2",
27
- "dompurify": "3.4.0",
27
+ "dompurify": "3.4.11",
28
28
  "fast-deep-equal": "^3.1.3",
29
29
  "fast-xml-parser": "5.7.3",
30
30
  "jotai": "^2.12.5",
@@ -41,7 +41,7 @@
41
41
  "web-vitals": "3.3.1",
42
42
  "@redocly/config": "0.49.0",
43
43
  "@redocly/redoc-opentelemetry": "0.2.0",
44
- "@redocly/replay": "0.25.0-next.6"
44
+ "@redocly/replay": "0.25.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@shikijs/transformers": "3.21.0",
@@ -55,9 +55,9 @@
55
55
  "@types/react-dom": "^19.2.3",
56
56
  "@vitejs/plugin-react": "5.1.2",
57
57
  "@vitest/coverage-v8": "4.1.8",
58
- "esbuild": "0.27.0",
58
+ "esbuild": "0.28.1",
59
59
  "jest-styled-components": "7.2.0",
60
- "js-yaml": "4.1.1",
60
+ "js-yaml": "4.2.0",
61
61
  "json-schema": "0.4.0",
62
62
  "outdent": "0.8.0",
63
63
  "path-browserify": "1.0.1",
@@ -71,7 +71,7 @@
71
71
  "url": "~0.11.0",
72
72
  "vite": "7.3.3",
73
73
  "vitest": "4.1.8",
74
- "@redocly/theme": "0.66.0-next.5"
74
+ "@redocly/theme": "0.66.0"
75
75
  },
76
76
  "scripts": {
77
77
  "start": "pnpm run copy-highlight-hook && vite",