@redocly/openapi-docs 3.12.0-rc.7 → 3.13.0-next.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.
- package/dist/redocly-openapi-docs.min.js +2168 -1942
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/Metadata.js +1 -1
- package/lib/components/ApiInfo/styled.js +6 -5
- package/lib/components/Content/useAutoScroll.js +1 -1
- package/lib/components/ExpandAllButton/ExpandAllButton.js +2 -2
- package/lib/components/OperationItem/Description.d.ts +1 -4
- package/lib/components/OperationItem/Description.js +1 -1
- package/lib/components/OperationItem/OperationItem.js +5 -5
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/Request/RequestDetails.js +2 -2
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/components/Samples/ExampleSwitch.js +1 -1
- package/lib/components/TagItem/TagItem.js +8 -8
- package/lib/components/common/Dropdown/Dropdown.d.ts +2 -1
- package/lib/components/common/Dropdown/Dropdown.js +43 -4
- package/lib/components/common/OperationItemTitle.d.ts +1 -0
- package/lib/components/common/OperationItemTitle.js +10 -5
- package/lib/components/common/SchemaSelection/SchemaSelection.js +1 -1
- package/lib/components/common/panels.js +22 -20
- package/lib/models/operation.js +1 -1
- package/lib/models/schema.js +2 -2
- package/lib/services/code-samples/httpsnippet/helpers/code-builder.d.ts +5 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-builder.js +2 -2
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +2 -2
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.js +2 -2
- package/lib/services/menu/markdown.js +1 -1
- package/lib/services/types.d.ts +0 -3
- package/lib/types/open-api.d.ts +1 -0
- package/lib/utils/loadAndBundleSpec.js +1 -1
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/string.js +1 -1
- package/package.json +6 -6
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as p from"util";import{Lang as i,NamingVariableConventions as l,VariableType as c}from"./constants.js";import o from"./string-utility.js";const S={[i.NODEJS]:l.CAMEL_CASE,[i.JAVASCRIPT]:l.CAMEL_CASE,[i.PYTHON]:l.UNDER_SCORES,[i.JAVA8]:l.CAMEL_CASE,[i.JAVA]:l.CAMEL_CASE,[i.CSHARP]:l.PASCAL_CASE,[i.CSHARPNEWTONSOFT]:l.PASCAL_CASE,[i.CURL]:l.CAMEL_CASE,[i.GO]:l.CAMEL_CASE,[i.PHP]:l.CAMEL_CASE,[i.RUBY]:l.UNDER_SCORES,[i.R]:l.UNDER_SCORES},u={default:{joinSymbol:"",variableWrapperFn:a=>a,stringLiteral:a=>a,variableDeclaration:a=>a,urlFieldName:"url"},[i.CSHARP]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`var ${a} = %s;`,urlFieldName:"fullUrl"},[i.CSHARPNEWTONSOFT]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`var ${a} = %s;`,urlFieldName:"fullUrl"},[i.GO]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`${a} := %s;`},[i.JAVA]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`var ${a} = %s;`,urlFieldName:"pathname"},[i.JAVA8]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`String ${a} = %s;`,urlFieldName:"fullUrl"},[i.JAVASCRIPT]:{variableWrapperFn:a=>"${"+a+"}",variableDeclaration:(a,e)=>`const ${a} = ${e?.hasVariableInterpolation?"`%s`":"'%s'"};`},[i.NODEJS]:{variableWrapperFn:a=>"${"+a+"}",variableDeclaration:(a,e)=>`const ${a} = ${e?.hasVariableInterpolation?"`%s`":"'%s'"};`},[i.PHP]:{joinSymbol:" . ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`const ${a} = %s;`},[i.PYTHON]:{stringLiteral:a=>`"${a}"`,joinSymbol:" + ",variableDeclaration:a=>`${a} = %s`},[i.RUBY]:{joinSymbol:" + ",stringLiteral:a=>`'${a}'`,variableDeclaration:a=>`${a} = %s`},[i.CURL]:{variableWrapperFn:(a,e)=>e||`{${a}}`,urlFieldName:"fullUrl",rawName:!0},[i.R]:{joinSymbol:" %&% ",variableDeclaration:a=>`${a} = %s`,urlFieldName:"fullUrl",stringLiteral:a=>`"${a}"`,variableWrapperFn:a=>`${a}`}},b=["response","request","requests","data","url","payload","main","accessToken","resp","Program","client","postData","App","httpClient","params","pathname","host","body","fetch","query"];class A{code;indentation;variablesPrefix;lineJoin;capitalize;lang;langOptions;constructor({indentation:e,lineJoin:t=`
|
|
2
2
|
`,variablesPrefix:r="",capitalize:n=!1,lang:s=i.CURL}){this.code=[],this.indentation=e,this.variablesPrefix=r,this.lineJoin=t||`
|
|
3
|
-
`,this.capitalize=n,this.lang=s,this.langOptions={...u.default,...u[s]}}buildLine(e,t){let r="",n=2;if(typeof e=="string")n=1,t=e,e=0;else if(e===null)return null;for(;e;)r+=this.indentation,e--;const s=Array.prototype.slice.call(arguments,n,arguments.length);return s.unshift(r+t),
|
|
3
|
+
`,this.capitalize=n,this.lang=s,this.langOptions={...u.default,...u[s]}}buildLine(e,t){let r="",n=2;if(typeof e=="string")n=1,t=e,e=0;else if(e===null)return null;for(;e;)r+=this.indentation,e--;const s=Array.prototype.slice.call(arguments,n,arguments.length);return s.unshift(r+t),p.format.apply(this,s)}unshift(...e){return this.code.unshift(this.buildLine.apply(this,e)),this}push(...e){return this.code.push(this.buildLine.apply(this,e)),this}blank(){return this.code.push(null),this}join(){return this.code.join(this.lineJoin)}clean(){this.code.splice(1)}var(e,t=c.CUSTOM){if(t===c.PATH){let r=this.variablesPrefix+e;switch(b.includes(r)&&(r=`${r}_path`),S[this.lang]){case l.UNDER_SCORES:r=o.toSnakeCase(r);break;case l.PASCAL_CASE:r=o.toPascalCase(r);break;case l.CAMEL_CASE:default:r=o.toCamelCase(r);break}return r}return this.variablesPrefix?this.variablesPrefix+(this.capitalize?o.toPascalCase(e):e):e}}export{A as CodeBuilder};
|
|
@@ -24,5 +24,5 @@ export type CodeOperand = {
|
|
|
24
24
|
* parseUrlIntoOperands("/url/:test/", {test: 1})
|
|
25
25
|
**/
|
|
26
26
|
export declare function parseUrlIntoOperands(url: string, params: Record<string, unknown>): CodeOperand[];
|
|
27
|
-
export declare function buildUrlExpression(source: SnippetRequest, code: CodeBuilder): string;
|
|
28
|
-
export declare function printUrlVariablesDeclarations(
|
|
27
|
+
export declare function buildUrlExpression(source: SnippetRequest, code: CodeBuilder, url?: string): string;
|
|
28
|
+
export declare function printUrlVariablesDeclarations(source: SnippetRequest, code: CodeBuilder, indentationLevel?: number): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{VariableType as
|
|
2
|
-
${e}`);return
|
|
1
|
+
import{VariableType as f}from"./constants.js";function x({body:r,authorizationHeader:a}){return function(n,s,e){return r&&s==="body"&&typeof n.body=="string"?n.body:a&&s==="Authorization"&&typeof n.Authorization=="string"?n.Authorization:e}}function d(r,{level:a=0,indent:n=" ",firstLine:s=!0}={}){const e=n.repeat(a),i=r.replace(/(\r\n|\n|\r)/gm,`
|
|
2
|
+
${e}`);return s?e.concat(i):i}function c(r,a){const s=Object.keys(a).map(t=>({name:t,idx:r.indexOf(`{${t}}`)})).filter(({idx:t})=>t>-1).sort((t,o)=>t.idx-o.idx),e=[];let i=0;for(const{name:t,idx:o}of s)o>i&&e.push({type:"string",value:r.substring(i,o)}),e.push({type:"variable",name:t}),i=o+t.length+2;return i<r.length&&e.push({type:"string",value:r.substring(i)}),e}function h(r,a,n){const{joinSymbol:s,variableWrapperFn:e,stringLiteral:i,urlFieldName:t,rawName:o}=a.langOptions,{pathParameters:b={},serverVariables:u={}}=r,p={...b,...u};return c(n??r[t]??"",p).map(l=>{if(l.type==="variable"){const m=p[l.name],v=o?l.name:a.var(l.name,f.PATH);return e(v,m)}else return i(l.value)}).join(s)}function y(r,a,n){const s={...r.pathParameters,...r.serverVariables};Object.entries(s).forEach(([e,i])=>{if(e==="server")return;const t=i||`YOUR_${e}_PARAMETER`,o=a.var(e,f.PATH),u=c(t,s).some(l=>l.type==="variable"),p=h(r,a,t);n!==void 0?a.push(n,a.langOptions.variableDeclaration(o,{hasVariableInterpolation:u}),p):a.push(a.langOptions.variableDeclaration(o,{hasVariableInterpolation:u}),p)})}export{d as addIndentation,h as buildUrlExpression,x as getPreserveTransformer,c as parseUrlIntoOperands,y as printUrlVariablesDeclarations};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import y from"@markdoc/markdoc";import{isString as A}from"@redocly/theme/core/openapi";import{getTagOrGroup as S}from"../../models/index.js";import{safeSlugify as h,unescapeHTMLChars as T}from"../../utils/index.js";import{simplifyAstStructure as d}from"../../utils/simplifyAstStructure.js";function O(e,u,f){const i=A(e)?d(y.parse(e)):y.Ast.fromJSON(JSON.stringify(e?.result)),s=[];let o;const l=(t,n,g=s,r,p)=>{t=T(t);let a;r.attributes.id?a=r.attributes.id:(a=p?`${p}/${h(t)}`:`section/${h(t)}`,r.attributes.id=a);const b={id:a.toLowerCase(),name:t,level:n,items:[],ast:[r]};return g.push(b),b},c=(t,n)=>{t[t.length-1]?.ast?.push(n)},m=t=>{const n=C(t)||"",r=u&&u.type==="tag"?u.id:void 0;t.type==="heading"&&t.attributes.level===1?o=l(n,t.attributes.level,void 0,t,r):t.attributes.level?l(n,t.attributes.level,o?.items,t,o?.id??r):o?.items?.length?c(o?.items,t):s?.length&&c(s,t)};if(Array.isArray(i))for(const t of i)m(t);else m(i);return v(u,s,f)}function v(e,u,f=1){return u.map(i=>{const s=S("section",i,e);return s.depth=f,i.items&&(s.items=v(s,i.items,f+1)),s})}function C(e){if(typeof e?.attributes?.content=="string")return e.attributes?.content;if(e?.children)return C(e.children[0])}export{O as addMarkdownItems};
|
package/lib/services/types.d.ts
CHANGED
package/lib/types/open-api.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export interface OpenAPIOperation extends ParsedDescriptionWithSummary {
|
|
|
105
105
|
'x-codeSamples'?: OpenAPIXCodeSample[];
|
|
106
106
|
'x-badges'?: OpenAPIXBadges[];
|
|
107
107
|
'x-hideReplay'?: boolean;
|
|
108
|
+
'x-owner-key'?: string;
|
|
108
109
|
}
|
|
109
110
|
export interface OpenAPIParameter extends ParsedDescription {
|
|
110
111
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bundle as s,Config as
|
|
1
|
+
import{bundle as s,Config as r}from"@redocly/openapi-core";import{IS_BROWSER as i}from"@redocly/theme/core/openapi";import{convertSwagger2OpenAPI as f}from"./convertSwagger2OpenAPI.js";async function l(o){const t=new r({}),e={config:t,base:i?window.location.origin:typeof globalThis.process<"u"?globalThis.process.cwd():""};i&&(t.resolve.http.customFetch=globalThis.fetch),typeof o=="object"&&o!==null?e.doc=a(o):e.ref=o;const{bundle:{parsed:n}}=await s(e);return n.swagger!==void 0?f(n):n}function a(o){return{source:{absoluteRef:""},parsed:o}}export{l as loadAndBundleDefinition};
|
package/lib/utils/openapi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as y}from"path";import f from"url-template";import{IS_BROWSER as M}from"@redocly/theme/core/openapi";import{deleteEmptyArrayItem as E,isArrayOfObjects as T,isNumeric as S,removeQueryStringAndHash as z,resolveUrl as D,sanitizeItemId as m,normalizeText as b,getValueFromMdParsedExtension as g,isAbsoluteUrl as N}from"./helpers.js";import{DEFAULT_TAG_SLUG as R,MediaTypes as j}from"../constants.js";import{JsonPointer as $}from"./JsonPointer.js";import{joinWithSeparator as _}from"../services/index.js";import{tryDecodeURIComponent as F}from"./string.js";import{getUrlDirname as U}from"./url.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 L={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0};function oe(e){return e in L}function ue(e){const{operationId:r,pathName:t}=e,n=b(g(e,"description"));return b(g(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function se(e,r){return r?.id?_(r.id,m(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?m(e.operationId?e.operationId:d(e.pointer)):m(e.operationId?_(R,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const
|
|
1
|
+
import{dirname as y}from"path";import f from"url-template";import{IS_BROWSER as M}from"@redocly/theme/core/openapi";import{deleteEmptyArrayItem as E,isArrayOfObjects as T,isNumeric as S,removeQueryStringAndHash as z,resolveUrl as D,sanitizeItemId as m,normalizeText as b,getValueFromMdParsedExtension as g,isAbsoluteUrl as N}from"./helpers.js";import{DEFAULT_TAG_SLUG as R,MediaTypes as j}from"../constants.js";import{JsonPointer as $}from"./JsonPointer.js";import{joinWithSeparator as _}from"../services/index.js";import{tryDecodeURIComponent as F}from"./string.js";import{getUrlDirname as U}from"./url.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 L={get:!0,post:!0,put:!0,head:!0,patch:!0,delete:!0,options:!0,$ref:!0};function oe(e){return e in L}function ue(e){const{operationId:r,pathName:t}=e,n=b(g(e,"description"));return b(g(e,"summary"))||r||n&&n.substring(0,50)||t||"<no summary>"}function se(e,r){return r?.id?_(r.id,m(e.operationId?e.operationId:d(e.pointer))).toLowerCase():e.tags?.length?m(e.operationId?e.operationId:d(e.pointer)):m(e.operationId?_(R,e.operationId):d(e.pointer))}function d(e){return e?.startsWith("/")?e.slice(1,e.length):e}const h={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(h);for(const t of r){const n=h[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 q(e){return e.search(/json/i)!==-1}function ce(e){return e?.search(/xml/i)!==-1}function pe(e){return e===j.URL_ENCODED}function fe(e){return e===j.MULTIPART}function c(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 w(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 a(e,r,t){const n="__redoc_param_name__",i=r?"*":"";return f.parse(`{?${n}${i}}`).expand({[n]:t}).substring(1).replace(/__redoc_param_name__/g,e)}function O(e,r){const t=e?"*":"",n="__redoc_param_name__",i=f.parse(`{${n}${t}}`);return F(i.expand({[n]:r}))}function me(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 a(t,o,n);case"spaceDelimited":return c(n,t,"%20");case"pipeDelimited":return c(n,t,"|");case"deepObject":return w(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 f.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 a(e,t,o);case"spaceDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style spaceDelimited is applicable to arrays or objects"),""):t?a(e,t,o):c(n,e,"%20");case"pipeDelimited":return!Array.isArray(o)&&typeof o!="object"?(console.warn("The style pipeDelimited is applicable to arrays or objects"),""):t?a(e,t,o):c(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"),""):w(o,e);case"simple":return O(t,n);default:return console.warn("Unexpected style for query: "+r),""}};return T(n)&&(n=E(n).map(o=>i(o))),i(n)}function C(e,r,t){switch(e){case"simple":return O(r,t);default:return console.warn("Unexpected style for header: "+e),""}}function B(e,r,t,n){switch(r){case"form":return a(e,t,n);default:return console.warn("Unexpected style for cookie: "+r),""}}function A(e,r){return q(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 A(r,o);case"cookie":case"query":return`${t}=${A(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 B(t,n,i,r);default:return console.warn("Unexpected parameter location: "+e.in),""}}function le(e){return e.search(/xml/i)!==-1?"xml":"clike"}const I=/^#\/components\/(schemas|pathItems)\/([^/]+)$/;function xe(e){return I.test(e||"")}function ye(e){return e?.match(I)?.pop()}function G(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 l(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 J(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 be(e){const r=[],t=l("characters",e.minLength,e.maxLength);t!==void 0&&r.push(t);const n=l("items",e.minItems,e.maxItems);n!==void 0&&r.push(n);const i=l(e.minProperties===1&&e.maxProperties===1?"property":"properties",e.minProperties,e.maxProperties);i!==void 0&&r.push(i);const o=G(e.multipleOf);o!==void 0&&r.push(o);const s=J(e);return s!==void 0&&r.push(s),e.uniqueItems&&r.push("unique"),r}function ge(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 je(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,p)=>({paramOrRef:u,pointer:$.join(n,["parameters",String(p)])})).filter(({paramOrRef:u})=>({resolved:u}=e.deref(u),!o[u.name+"_"+u.in])),x=t.map((u,p)=>({paramOrRef:u,pointer:$.join(i,["parameters",String(p)])}));return[...s,...x]}function _e(e,r){const n=e===void 0?z((()=>{if(!M)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?y(i):i})()):N(e)?U(e):y(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?D(n,i.url):i.url,description:i.description||""}))}const Pe=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-hideReplay":!0,"x-feedback":!0,"x-badges":!0,"x-assertionType":!0,"x-rbac":!0}||e.startsWith("x-parsed-md-")}function he(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 we(e){return e.split(" or ").map(r=>r.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/,"$1s$2")).join(" or ")}function Oe(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,he as extractExtensions,Oe as getContentWithLegacyExamples,ye as getDefinitionName,se as getOperationId,ue as getOperationName,ie as getStatusCodeType,be as humanizeConstraints,J as humanizeNumberRange,pe as isFormUrlEncoded,q as isJsonLike,fe as isMultipartFormData,xe as isNamedDefinition,oe as isOperationName,k as isPrimitiveType,Q as isRedocExtension,ne as isStatusCode,ce as isXmlLike,le as langFromMime,$e as mergeParams,_e as normalizeServers,we as pluralizeType,de as serializeParameterValue,A as serializeParameterValueWithMime,H as serializeQueryParameter,Pe as shortenHTTPVerb,je as sortByDeprecated,ge as sortByRequired,me as urlFormEncodePayload};
|
package/lib/utils/string.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"slugify";function o(e){return e.split("").map(r=>r+"\u0335").join("")}function c(e){return e.replace(/[.[\]]/g,r=>({".":"%2e","[":"%5b","]":"%5d"})[r]||"")}function
|
|
1
|
+
import t from"slugify";function o(e){return e.split("").map(r=>r+"\u0335").join("")}function c(e){return e.replace(/[.[\]]/g,r=>({".":"%2e","[":"%5b","]":"%5d"})[r]||"")}function p(e){return e.replace(/%2e|%5b|%5d/g,r=>({"%2e":".","%5b":"[","%5d":"]"})[r]||"")}function u(e){return e.replace(/\\/g,"%5C")}function a(e){return e.replace(/%/g,"")}function i(e){try{return decodeURIComponent(e)}catch(r){return console.error(`Decoding failed: ${e}`,r),e}}function f(e){return t(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function l(e,r={}){try{return JSON.parse(e)}catch{return r}}export{u as encodeBackSlashes,c as escapeFormId,a as removePercentChart,l as safeJsonParse,f as safeSlugify,o as strikethroughText,i as tryDecodeURIComponent,p as unescapeFormId};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0-next.0",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"npm": ">=10.0.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@redocly/theme": ">=0.
|
|
17
|
+
"@redocly/theme": ">=0.57.0-next.0",
|
|
18
18
|
"react": "^19.1.0",
|
|
19
19
|
"react-dom": "^19.1.0",
|
|
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": "
|
|
24
|
+
"@redocly/openapi-core": "2.0.2",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.6",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"url-template": "^2.0.8",
|
|
37
37
|
"util": "~0.12.5",
|
|
38
38
|
"web-vitals": "3.3.1",
|
|
39
|
-
"@redocly/config": "0.
|
|
40
|
-
"@redocly/replay": "0.
|
|
39
|
+
"@redocly/config": "0.28.0",
|
|
40
|
+
"@redocly/replay": "0.16.0-next.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typescript": "5.6.2",
|
|
75
75
|
"url": "~0.11.0",
|
|
76
76
|
"vite": "^6.3.5",
|
|
77
|
-
"@redocly/theme": "0.
|
|
77
|
+
"@redocly/theme": "0.57.0-next.0"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"start": "npm run copy-highlight-hook && vite",
|