@redocly/openapi-docs 3.18.0-next.9 → 3.18.0

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{jsx as h,Fragment as E,jsxs as u}from"react/jsx-runtime";import{memo as O}from"react";import{useAtom as g}from"jotai";import{ExampleSwitch as v,useExampleKey as j}from"../Samples/index.js";import{useActivateExample as K,useTelemetry as C}from"../../hooks/index.js";import{operationStore as b}from"../../jotai/operation.js";function P({mediaType:e,mediaContent:m,renderSample:a}){const l=C(),p=e.operation.pointer,[n,x]=g(b(p)),s=e.examples||e.formExamples||{},t=Object.keys(s),i=K(m),{exampleKey:c}=j(e.operation,s),r=t[n.activeOneOf[e?.examplesPointer||e.operation.pointer]]||c;return!t.length||t.length===1?a():u(E,{children:[h(v,{examples:s,exampleKey:r,onChange:o=>{const f=e.examplesPointer&&e.examplesPointer.startsWith(e.operation.pointer)?e.examplesPointer:e.operation.pointer;l.sendExamplesSwitcherClickedMessage([{object:"examples_switcher",exampleNumber:t.indexOf(o),totalExamples:t.length}]),x({...n,activeExampleName:o,activeOneOf:{...n.activeOneOf,[f]:t.indexOf(o)},requestValues:{body:null}}),i(o)}}),a(r)]})}const M=O(P);export{M as Example};
1
+ import{jsx as h,Fragment as u,jsxs as E}from"react/jsx-runtime";import{memo as O}from"react";import{useAtom as g}from"jotai";import{ExampleSwitch as v,useExampleKey as j}from"../Samples/index.js";import{useActivateExample as w,useTelemetry as K}from"../../hooks/index.js";import{operationStore as b}from"../../jotai/operation.js";function C({mediaType:e,mediaContent:l,renderSample:r}){const m=K(),p=e.operation.pointer,[n,i]=g(b(p)),s=e.examples||e.formExamples||{},t=Object.keys(s),x=w(l),{exampleKey:c}=j(e.operation,s),a=t[n.activeOneOf[e?.examplesPointer||e.operation.pointer]]||c;return!t.length||t.length===1?r():E(u,{children:[h(v,{examples:s,exampleKey:a,onChange:o=>{const f=e.examplesPointer&&e.examplesPointer.startsWith(e.operation.pointer)?e.examplesPointer:e.operation.pointer;m.sendExamplesSwitcherClickedMessage([{id:"examples-switcher-request-body",uri:window.location.href,object:"examples_switcher",exampleNumber:t.indexOf(o),totalExamples:t.length}]),i({...n,activeExampleName:o,activeOneOf:{...n.activeOneOf,[f]:t.indexOf(o)},requestValues:{body:null}}),x(o)}}),r(a)]})}const M=O(C);export{M as Example};
@@ -1 +1 @@
1
- import{jsx as m}from"react/jsx-runtime";import{useState as d,useEffect as h}from"react";import{MimeLabel as x,Container as b,Select as v}from"../common/index.js";import{SelectOrLabel as S}from"../SelectOrLabel/index.js";import{normalizeText as g}from"../../utils/index.js";import{useTelemetry as j}from"../../hooks/index.js";const L=({exampleKey:s,examples:o,onChange:n,className:c})=>{const i=j(),r=Object.keys(o),t=s?r.indexOf(s):0,[p,l]=d(t>-1?t:0);h(()=>l(t>-1?t:0),[s,t]);const a=r.map((e,f)=>({value:g(o[e].summary)||e,idx:f})),u=({idx:e})=>{i.sendExamplesSwitcherClickedMessage([{object:"examples_switcher",exampleNumber:e,totalExamples:r.length}]),l(e),n(r[e])};return a.length<2?null:m(b,{"data-testid":"example-switch",className:c,children:m(S,{Select:v,Label:x,variant:"dark",fullWidth:!0,options:a,value:a[p]?.value,onChange:u})})};export{L as ExampleSwitch};
1
+ import{jsx as i}from"react/jsx-runtime";import{useState as d,useEffect as p}from"react";import{MimeLabel as h,Container as x,Select as v}from"../common/index.js";import{SelectOrLabel as S}from"../SelectOrLabel/index.js";import{normalizeText as b}from"../../utils/index.js";const O=({exampleKey:o,examples:n,onChange:l,className:c})=>{const a=Object.keys(n),t=o?a.indexOf(o):0,[m,s]=d(t>-1?t:0);p(()=>s(t>-1?t:0),[o,t]);const r=a.map((e,f)=>({value:b(n[e].summary)||e,idx:f})),u=({idx:e})=>{s(e),l(a[e])};return r.length<2?null:i(x,{"data-testid":"example-switch",className:c,children:i(S,{Select:v,Label:h,variant:"dark",fullWidth:!0,options:r,value:r[m]?.value,onChange:u})})};export{O as ExampleSwitch};
@@ -10,7 +10,7 @@ interface ScopeTagWithTooltipProps {
10
10
  tip?: string | ReactNode;
11
11
  ariaLabel?: string;
12
12
  TagComponent?: ComponentType<TagComponentProps>;
13
- arrowPosition?: 'top' | 'bottom' | 'left' | 'right' | 'center';
13
+ arrowPosition?: 'left' | 'right' | 'center';
14
14
  compact?: boolean;
15
15
  }
16
16
  export declare function ScopeTagWithTooltip({ className, text, maxChars, tip, ariaLabel, TagComponent, arrowPosition, compact, }: ScopeTagWithTooltipProps): ReactElement;
@@ -1 +1 @@
1
- import{getContentWithLegacyExamples as f,getValueFromMdParsedExtension as m,JsonPointer as p}from"../utils/index.js";import{getMediaContent as q}from"./mediaContent.js";function y({parser:t,infoOrRef:n,options:s,isEvent:d,operation:o}){const{resolved:e}=t.deref(n),u=m(e,"description")||"",c=e.required;let i;const a=!d,r=f(e);return r!==void 0&&(i=q({parser:t,info:r,isRequestType:a,options:s,data:{operation:o,type:"request",absolutePointer:n.$ref||p.join(o.pointer,["requestBody"])}})),{description:u,required:c,content:i}}export{y as getRequestBody};
1
+ import{getValueFromMdParsedExtension as m,JsonPointer as q,getContent as p}from"../utils/index.js";import{getMediaContent as a}from"./mediaContent.js";function y({parser:e,infoOrRef:n,options:d,isEvent:s,operation:o}){const{resolved:t}=e.deref(n),u=m(t,"description")||"",c=t.required;let i;const f=!s,r=p(e,t);return r!==void 0&&(i=a({parser:e,info:r,isRequestType:f,options:d,data:{operation:o,type:"request",absolutePointer:n.$ref||q.join(o.pointer,["requestBody"])}})),{description:u,required:c,content:i}}export{y as getRequestBody};
@@ -1 +1 @@
1
- import{getStatusCodeType as h,getContentWithLegacyExamples as x,JsonPointer as c,getValueFromMdParsedExtension as d}from"../utils/index.js";import{getField as C}from"./field.js";import{getMediaContent as j}from"./mediaContent.js";function F({parser:n,code:s,defaultAsError:f,infoOrRef:m,options:p,isEvent:y,operation:o}){const g=!!y,{resolved:t}=n.deref(m),e={code:s};t["x-summary"]!==void 0?(e.summary=d(t,"x-summary"),e.description=d(t,"description")||""):(e.summary=d(t,"description")||"",e.description=""),e.type=h(s,f);const r=t.headers,a=m.$ref||c.join(o?.pointer||"",["responses",s]);r!==void 0&&(e.headers=Object.keys(r).map(i=>{const l=r[i];return C(n,{...l,name:i},c.join(a,["headers",i]),p,{operation:o,type:"response",response:e})}));const u=x(t);return u!==void 0&&(e.content=j({parser:n,info:u,isRequestType:g,options:p,data:{operation:o,type:"response",response:e,absolutePointer:a}})),e}export{F as getResponse};
1
+ import{getStatusCodeType as h,JsonPointer as c,getValueFromMdParsedExtension as d,getContent as x}from"../utils/index.js";import{getField as C}from"./field.js";import{getMediaContent as j}from"./mediaContent.js";function M({parser:n,code:s,defaultAsError:a,infoOrRef:m,options:p,isEvent:y,operation:o}){const g=!!y,{resolved:t}=n.deref(m),e={code:s};t["x-summary"]!==void 0?(e.summary=d(t,"x-summary"),e.description=d(t,"description")||""):(e.summary=d(t,"description")||"",e.description=""),e.type=h(s,a);const i=t.headers,u=m.$ref||c.join(o?.pointer||"",["responses",s]);i!==void 0&&(e.headers=Object.keys(i).map(r=>{const l=i[r];return C(n,{...l,name:r},c.join(u,["headers",r]),p,{operation:o,type:"response",response:e})}));const f=x(n,t);return f!==void 0&&(e.content=j({parser:n,info:f,isRequestType:g,options:p,data:{operation:o,type:"response",response:e,absolutePointer:u}})),e}export{M as getResponse};
@@ -313,6 +313,9 @@ export interface OpenAPIComponents {
313
313
  callbacks?: {
314
314
  [name: string]: Referenced<OpenAPICallback>;
315
315
  };
316
+ mediaTypes?: {
317
+ [name: string]: Referenced<OpenAPIMediaType>;
318
+ };
316
319
  }
317
320
  export interface OpenAPISecurityRequirement {
318
321
  [name: string]: string[];
@@ -38,6 +38,9 @@ export declare const shortenHTTPVerb: (verb: string) => string;
38
38
  export declare function isRedocExtension(key: string): boolean;
39
39
  export declare function extractExtensions(obj: GenericObject, showExtensions: string[] | true): GenericObject;
40
40
  export declare function pluralizeType(displayType: string): string;
41
+ export declare function getContent(parser: OpenAPIParser, info: OpenAPIRequestBody | OpenAPIResponse): {
42
+ [mime: string]: OpenAPIMediaType;
43
+ } | undefined;
41
44
  export declare function getContentWithLegacyExamples(info: OpenAPIRequestBody | OpenAPIResponse): {
42
45
  [mime: string]: OpenAPIMediaType;
43
46
  } | undefined;
@@ -1 +1 @@
1
- import{dirname as b}from"path";import m from"url-template";import{deleteEmptyArrayItem as w,isArrayOfObjects as E,isNumeric as S,removeQueryStringAndHash as T,resolveUrl as N,sanitizeItemId as l,normalizeText as g,getValueFromMdParsedExtension as j,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 $}from"../services/index.js";import{tryDecodeURIComponent as R}from"./string.js";import{getUrlDirname as q}from"./url.js";import{IS_BROWSER as L}from"./dom.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ne(e){return e==="default"||S(e)||P(e)}function ie(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(P(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 U={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0,"x-query":!0,query:!0};function oe(e){return e in U}function ue(e){const{operationId:r,pathName:t}=e,n=g(j(e,"description"));return g(j(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function se(e,r){return r?.id?$(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?$(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 ae(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 F(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=F(e.items,e.items.type)),t)}function k(e){return e.search(/json/i)!==-1}function ce(e){return e?.search(/xml/i)!==-1}function pe(e){return e===a.URL_ENCODED}function fe(e){return e===a.MULTIPART}function me(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 A(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 I(e,r){const t=e?"*":"",n="__redoc_param_name__",i=m.parse(`{${n}${t}}`);return R(i.expand({[n]:r}))}function le(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 A(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function W(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 H(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"),""):A(o,e);case"simple":return I(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return E(n)&&(n=w(n).map(o=>i(o))),i(n)}function C(e,r,t){switch(e){case"simple":return I(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function J(e,r,t,n){switch(r){case"form":return c(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function M(e,r){return k(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function de(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return M(r,o);case"cookie":case"query":return`${t}=${M(r,o)}`;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 W(t,n,i,r);case"query":return H(t,n,i,r);case"header":return C(n,i,r);case"cookie":return J(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function xe(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 h=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function ye(e){return h.test(e||"")}function be(e){return e?.match(h)?.pop()}function B(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 x(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 G(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 ge(e){const r=[],t=x("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=x("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=x(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=B(e.multipleOf);o!==void 0&&r.push(o);const s=G(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function je(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 _e(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function $e(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])),y=t.map((u,f)=>({paramOrRef:u,pointer:_.join(i,["parameters",String(f)])}));return[...s,...y]}function Pe(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)?q(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 Oe=e=>({delete:"del",options:"opts"})[e]||e;function Q(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 Ae(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Q(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function Ie(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Me(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{ae as detectType,Ae as extractExtensions,Me as getContentWithLegacyExamples,be as getDefinitionName,se as getOperationId,ue as getOperationName,ie as getStatusCodeType,ge as humanizeConstraints,G as humanizeNumberRange,pe as isFormUrlEncoded,k as isJsonLike,fe as isMultipartFormData,ye as isNamedDefinition,oe as isOperationName,F as isPrimitiveType,Q as isRedocExtension,me as isSequentialMediaType,ne as isStatusCode,ce as isXmlLike,xe as langFromMime,$e as mergeParams,Pe as normalizeServers,Ie as pluralizeType,de as serializeParameterValue,M as serializeParameterValueWithMime,H as serializeQueryParameter,Oe as shortenHTTPVerb,_e as sortByDeprecated,je as sortByRequired,le as urlFormEncodePayload};
1
+ import{dirname as g}from"path";import m from"url-template";import{deleteEmptyArrayItem as w,isArrayOfObjects as E,isNumeric as S,removeQueryStringAndHash as T,resolveUrl as N,sanitizeItemId as l,normalizeText as b,getValueFromMdParsedExtension as j,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 $}from"../services/index.js";import{tryDecodeURIComponent as R}from"./string.js";import{getUrlDirname as q}from"./url.js";import{IS_BROWSER as L}from"./dom.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ie(e){return e==="default"||S(e)||P(e)}function oe(e,r=!1){if(e==="default")return r?"error":"success";let t=typeof e=="string"?parseInt(e,10):e;if(P(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 U={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0,"x-query":!0,query:!0};function ue(e){return e in U}function se(e){const{operationId:r,pathName:t}=e,n=b(j(e,"description"));return b(j(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function ae(e,r){return r?.id?$(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?$(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 ce(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 F(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=F(e.items,e.items.type)),t)}function k(e){return e.search(/json/i)!==-1}function pe(e){return e?.search(/xml/i)!==-1}function fe(e){return e===a.URL_ENCODED}function me(e){return e===a.MULTIPART}function le(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 A(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 I(e,r){const t=e?"*":"",n="__redoc_param_name__",i=m.parse(`{${n}${t}}`);return R(i.expand({[n]:r}))}function de(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 A(n,t);default:return console.warn("Incorrect or unsupported encoding style: "+i),""}}).join("&")}function W(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 C(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"),""):A(o,e);case"simple":return I(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return E(n)&&(n=w(n).map(o=>i(o))),i(n)}function H(e,r,t){switch(e){case"simple":return I(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function J(e,r,t,n){switch(r){case"form":return c(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function M(e,r){return k(r)?JSON.stringify(e):(console.warn(`Parameter serialization as ${r} is not supported`),"")}function xe(e,r){const{name:t,style:n,explode:i=!1,serializationMime:o}=e;if(o)switch(e.in){case"path":case"header":return M(r,o);case"cookie":case"query":return`${t}=${M(r,o)}`;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 W(t,n,i,r);case"query":return C(t,n,i,r);case"header":return H(n,i,r);case"cookie":return J(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function ye(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 h=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function ge(e){return h.test(e||"")}function be(e){return e?.match(h)?.pop()}function B(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 x(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 G(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 je(e){const r=[],t=x("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=x("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=x(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=B(e.multipleOf);o!==void 0&&r.push(o);const s=G(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function _e(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 $e(e){return e.sort((r,t)=>Number(r.deprecated)-Number(t.deprecated))}function Pe(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])),y=t.map((u,f)=>({paramOrRef:u,pointer:_.join(i,["parameters",String(f)])}));return[...s,...y]}function Oe(e,r){const n=e===void 0?T((()=>{if(!L)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?g(i):i})()):z(e)?q(e):g(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 Q(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 Ie(e,r){return Object.keys(e).filter(t=>r===!0?t.startsWith("x-")&&!Q(t):t.startsWith("x-")&&r.indexOf(t)>-1).reduce((t,n)=>(t[n]=e[n],t),{})}function Me(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function he(e,r){const{resolved:t}=e.deref(r.content);return X({...r,content:t})}function X(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{ce as detectType,Ie as extractExtensions,he as getContent,X as getContentWithLegacyExamples,be as getDefinitionName,ae as getOperationId,se as getOperationName,oe as getStatusCodeType,je as humanizeConstraints,G as humanizeNumberRange,fe as isFormUrlEncoded,k as isJsonLike,me as isMultipartFormData,ge as isNamedDefinition,ue as isOperationName,F as isPrimitiveType,Q as isRedocExtension,le as isSequentialMediaType,ie as isStatusCode,pe as isXmlLike,ye as langFromMime,Pe as mergeParams,Oe as normalizeServers,Me as pluralizeType,xe as serializeParameterValue,M as serializeParameterValueWithMime,C as serializeQueryParameter,Ae as shortenHTTPVerb,$e as sortByDeprecated,_e as sortByRequired,de as urlFormEncodePayload};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.18.0-next.9",
3
+ "version": "3.18.0",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@redocly/theme": ">=0.62.0-next.0",
18
- "react": "19.2.4",
19
- "react-dom": "19.2.4",
18
+ "react": "^19.2.4",
19
+ "react-dom": "^19.2.4",
20
20
  "styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
21
21
  },
22
22
  "dependencies": {
23
23
  "@markdoc/markdoc": "0.5.2",
24
- "@redocly/openapi-core": "2.15.1",
24
+ "@redocly/openapi-core": "2.15.2",
25
25
  "deepmerge": "^4.2.2",
26
26
  "dompurify": "3.2.7",
27
27
  "fast-deep-equal": "^3.1.3",
@@ -30,7 +30,7 @@
30
30
  "jotai-family": "^1.0.1",
31
31
  "json-pointer": "^0.6.2",
32
32
  "openapi-sampler": "1.6.2",
33
- "react-router-dom": "^6.21.1",
33
+ "react-router-dom": "^6.30.3",
34
34
  "slugify": "^1.4.4",
35
35
  "stringify-object": "^3.3.0",
36
36
  "styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0",
@@ -38,8 +38,8 @@
38
38
  "url-template": "^2.0.8",
39
39
  "util": "~0.12.5",
40
40
  "web-vitals": "3.3.1",
41
- "@redocly/config": "0.41.4",
42
- "@redocly/replay": "0.21.0-next.9"
41
+ "@redocly/replay": "0.21.0",
42
+ "@redocly/config": "0.42.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@shikijs/transformers": "3.21.0",
@@ -61,8 +61,8 @@
61
61
  "outdent": "0.8.0",
62
62
  "path-browserify": "1.0.1",
63
63
  "prettier-2": "npm:prettier@2.8.8",
64
- "react": "19.2.4",
65
- "react-dom": "19.2.4",
64
+ "react": "^19.2.4",
65
+ "react-dom": "^19.2.4",
66
66
  "rimraf": "5.0.7",
67
67
  "rollup-plugin-bundle-stats": "^4.20.2",
68
68
  "shiki": "3.21.0",
@@ -72,7 +72,7 @@
72
72
  "url": "~0.11.0",
73
73
  "vite": "7.2.6",
74
74
  "vitest": "4.0.10",
75
- "@redocly/theme": "0.62.0-next.6"
75
+ "@redocly/theme": "0.62.0"
76
76
  },
77
77
  "scripts": {
78
78
  "start": "pnpm run copy-highlight-hook && vite",