@redocly/openapi-docs 3.15.0-rc.5 → 3.15.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 +4324 -3482
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/Metadata.js +1 -1
- package/lib/components/ContentItem/ContentItem.js +1 -1
- package/lib/components/Discriminator/DefaultMappingOption.d.ts +5 -0
- package/lib/components/Discriminator/DefaultMappingOption.js +15 -0
- package/lib/components/Discriminator/Discriminator.js +16 -2
- package/lib/components/Download/DownloadSpecification.js +2 -2
- package/lib/components/ExpandAllButton/ExpandAllButton.js +1 -1
- package/lib/components/Language/LanguageList.js +1 -1
- package/lib/components/McpOverview/McpOverview.js +3 -7
- package/lib/components/McpTool/McpTool.d.ts +1 -1
- package/lib/components/McpTool/McpTool.js +1 -1
- package/lib/components/McpTool/index.d.ts +0 -2
- package/lib/components/McpTool/index.js +1 -1
- package/lib/components/Overview/Overview.js +1 -1
- package/lib/components/PanelItem/styled.js +5 -9
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/styled.js +6 -2
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +3 -0
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/components/RightPanel/RightPanel.js +1 -5
- package/lib/components/Samples/ExampleSwitch.js +1 -1
- package/lib/components/SchemaCatalogLink/tests/SchemaCatalogLink.test.js +1 -1
- package/lib/components/SectionContent/SectionContent.js +4 -4
- package/lib/components/ServerList/ServerList.js +11 -11
- package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/TagItem/OperationsNavigation.js +2 -2
- package/lib/components/TagItem/TagItem.js +6 -7
- package/lib/components/common/Dropdown/Dropdown.d.ts +3 -3
- package/lib/components/common/Dropdown/Dropdown.js +9 -9
- package/lib/components/common/Fields/fields.js +3 -5
- package/lib/components/common/SchemaSelection/SchemaSelection.d.ts +2 -2
- package/lib/components/common/SchemaSelection/SchemaSelection.js +1 -1
- package/lib/hooks/index.d.ts +1 -1
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useRouter.js +1 -1
- package/lib/icons/DefaultMappingIcon/DefaultMappingIcon.d.ts +4 -0
- package/lib/icons/DefaultMappingIcon/DefaultMappingIcon.js +8 -0
- package/lib/icons/DefaultMappingIcon/index.d.ts +1 -0
- package/lib/icons/DefaultMappingIcon/index.js +1 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -1
- package/lib/models/group.js +1 -1
- package/lib/models/mediaType.js +1 -1
- package/lib/models/schema.d.ts +2 -1
- package/lib/models/schema.js +2 -2
- package/lib/models/types.d.ts +2 -0
- package/lib/services/menu/builder.js +1 -1
- package/lib/services/menu/markdown.js +1 -1
- package/lib/services/menu/tags.js +2 -4
- package/lib/services/types.d.ts +2 -7
- package/lib/standalone.js +1 -1
- package/lib/types/open-api.d.ts +3 -13
- package/lib/utils/loadAndBundleSpec.js +1 -1
- package/lib/utils/mcp.d.ts +1 -1
- package/lib/utils/mcp.js +1 -1
- package/lib/utils/menu.js +1 -1
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/string.js +1 -1
- package/package.json +11 -9
- package/lib/components/McpTool/McpPrompt.d.ts +0 -6
- package/lib/components/McpTool/McpPrompt.js +0 -9
- package/lib/components/McpTool/McpResource.d.ts +0 -7
- package/lib/components/McpTool/McpResource.js +0 -14
- package/lib/components/RedoclyOpenAPIDocs/Error.d.ts +0 -3
- package/lib/components/RedoclyOpenAPIDocs/Error.js +0 -25
package/lib/utils/menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function n(e){return e.type==="operation"||e.type==="schema"||e.type==="mcp"}export{n as isRenderableMenuItem};
|
package/lib/utils/openapi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as y}from"path";import f from"url-template";import{deleteEmptyArrayItem as M,isArrayOfObjects as E,isNumeric as T,removeQueryStringAndHash as S,resolveUrl as z,sanitizeItemId as m,normalizeText as b,getValueFromMdParsedExtension as g,isAbsoluteUrl as D}from"./helpers.js";import{DEFAULT_TAG_SLUG as N,MediaTypes as j}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 F}from"./url.js";import{IS_BROWSER as U}from"./dom.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ne(e){return e==="default"||T(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?_(N,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{deleteEmptyArrayItem as M,isArrayOfObjects as E,isNumeric as T,removeQueryStringAndHash as S,resolveUrl as z,sanitizeItemId as m,normalizeText as b,getValueFromMdParsedExtension as g,isAbsoluteUrl as D}from"./helpers.js";import{DEFAULT_TAG_SLUG as N,MediaTypes as j}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 F}from"./url.js";import{IS_BROWSER as U}from"./dom.js";function P(e){return typeof e=="string"&&/\dxx/i.test(e)}function ne(e){return e==="default"||T(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?_(N,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 R(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 E(n)&&(n=M(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?S((()=>{if(!U)return globalThis.SSR_HOSTNAME||"";const i=window.location.href;return i.endsWith(".html")?y(i):i})()):D(e)?F(e):y(e);return r.length===0&&(r=[{url:"/"}]),r.map(i=>({...i,url:n?z(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-badges":!0,"x-hideReplay":!0,"x-feedback":!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.15.0
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "2.
|
|
24
|
+
"@redocly/openapi-core": "2.10.0",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.7",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
28
28
|
"jotai": "^2.12.5",
|
|
29
29
|
"json-pointer": "^0.6.2",
|
|
30
|
-
"openapi-sampler": "
|
|
30
|
+
"openapi-sampler": "1.6.2",
|
|
31
31
|
"react-router-dom": "^6.21.1",
|
|
32
32
|
"slugify": "^1.4.4",
|
|
33
33
|
"stringify-object": "^3.3.0",
|
|
@@ -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.18.0
|
|
39
|
+
"@redocly/config": "0.38.0",
|
|
40
|
+
"@redocly/replay": "0.18.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"@types/jest-when": "3.5.5",
|
|
50
50
|
"@types/json-pointer": "1.0.34",
|
|
51
51
|
"@types/json-schema": "^7.0.15",
|
|
52
|
-
"@types/node": "22.
|
|
52
|
+
"@types/node": "22.18.13",
|
|
53
53
|
"@types/react": "^19.1.4",
|
|
54
54
|
"@types/react-dom": "^19.1.4",
|
|
55
55
|
"@types/styled-components": "5.1.34",
|
|
56
|
-
"@vitejs/plugin-react": "
|
|
56
|
+
"@vitejs/plugin-react": "5.0.4",
|
|
57
57
|
"esbuild": "0.25.10",
|
|
58
58
|
"jest": "29.5.0",
|
|
59
59
|
"jest-environment-jsdom": "29.5.0",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"tsx": "4.20.3",
|
|
75
75
|
"typescript": "5.9.3",
|
|
76
76
|
"url": "~0.11.0",
|
|
77
|
-
"vite": "
|
|
78
|
-
"@redocly/theme": "0.59.0
|
|
77
|
+
"vite": "7.1.9",
|
|
78
|
+
"@redocly/theme": "0.59.0"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"start": "npm run copy-highlight-hook && vite",
|
|
@@ -85,7 +85,9 @@
|
|
|
85
85
|
"prepare:community-source": "npx tsx scripts/prepare-community-source.ts --",
|
|
86
86
|
"prepare:community-source-only": "npm run prepare:community-source --ignore /src/* private-readme.md",
|
|
87
87
|
"prepare:community-dependencies": "npx tsx scripts/prepare-community-dependencies.ts",
|
|
88
|
+
"apply:community-source": "npx tsx scripts/apply-changes-from-community-source.ts",
|
|
88
89
|
"test": "npm run prepare:community-source && cd redoc && npm install && npm run lint && npm run unit && cd ../ && jest -w 2",
|
|
90
|
+
"unit": "jest -w 2",
|
|
89
91
|
"test:update": "jest -u",
|
|
90
92
|
"test:watch": "jest --watch",
|
|
91
93
|
"test:coverage": "jest --coverage",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as c,Fragment as T}from"react/jsx-runtime";import{memo as k,useCallback as C,useMemo as u}from"react";import{useAtomValue as f}from"jotai";import{LayoutVariant as P}from"@redocly/config";import{getMediaContent as j,getSecurity as A}from"../../models/index.js";import{globalStoreAtom as g}from"../../jotai/store.js";import{Section as b,Row as q,SamplesMiddlePanel as v,SamplesPanel as F,CodeBlockPanel as L}from"../common/index.js";import{Schema as R}from"../Schema/index.js";import{layoutAtom as _}from"../../jotai/app.js";import{MediaTypeSamples as w}from"../PayloadSamples/MediaTypeSamples.js";import{useTranslate as D}from"../../hooks/index.js";import{Title as E}from"../common/OperationItemTitle.js";import{LinkToField as V}from"../common/LinkToField.js";import{makeDeepLink as B}from"../../services/index.js";import{Security as K}from"../Security/Security.js";import{styled as x}from"../../styled-components.js";function N({name:n,id:l}){const{parser:e}=f(g),i=D(),r=u(()=>(e.definition["x-mcp"]?.prompts||[]).find(p=>p.name===n),[e,n]),m=u(()=>r?A(r.security,e):null,[e,r]);return r?t(b,{children:t(z,{id:l,type:"input",prompt:r,title:i("openapi.mcp.inputSchema","Arguments"),exampleTitle:i("openapi.mcp.inputExample","Arguments example"),children:m&&t(K,{securities:m})})}):null}function z({id:n,type:l,prompt:e,title:i,exampleTitle:r,children:m}){const{parser:d,options:p}=f(g),y=f(_),h=y===P.STACKED,a=u(()=>{const S=e.arguments&&{type:"object",properties:e.arguments.reduce((o,s)=>(o[s.name]={type:"",example:s.example||"string",description:s.description,required:s.required},o),{}),required:e.arguments.filter(o=>o.required).map(o=>o.name)};return S?j({parser:d,info:{"application/json":{schema:S}},isRequestType:!1,options:p,data:{operation:{pointer:"McpPrompt"}}}):null},[p,d,e]),M=C(()=>{},[]);return c(G,{layout:y,children:[t(H,{isStacked:h,children:c("div",{children:[m,a&&c(T,{children:[" ",c(E,{children:[n&&t(V,{to:B(n,l)}),i]}),t(R,{schema:a.mediaTypes[0].schema})]})]})}),a&&t(F,{isStacked:h,children:t(L,{className:"panel-response-samples",header:r,children:t(w,{mediaType:a.mediaTypes[0],onChange:M})})})]})}const G=x(q)`
|
|
2
|
-
margin: calc(var(--spacing-unit) * 2) 0;
|
|
3
|
-
|
|
4
|
-
& + & {
|
|
5
|
-
margin-top: calc(var(--spacing-base) * 2);
|
|
6
|
-
}
|
|
7
|
-
`,H=x(v)`
|
|
8
|
-
padding-left: 0;
|
|
9
|
-
`,me=k(N);export{me as McpPrompt};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{jsxs as l,jsx as o}from"react/jsx-runtime";import{memo as k,useMemo as T}from"react";import*as M from"react";import{useAtomValue as h}from"jotai";import{LayoutVariant as R}from"@redocly/config";import{CodeBlock as b}from"@redocly/theme/components/CodeBlock/CodeBlock";import{Tag as P}from"@redocly/theme/components/Tag/Tag";import{getSecurity as v}from"../../models/index.js";import{globalStoreAtom as j}from"../../jotai/store.js";import{Section as w,Row as A,SamplesMiddlePanel as B,SamplesPanel as F,CodeBlockPanel as E}from"../common/index.js";import{layoutAtom as I}from"../../jotai/app.js";import{useTranslate as L}from"../../hooks/index.js";import{Security as V}from"../Security/Security.js";import{styled as s}from"../../styled-components.js";function _({name:i}){const{parser:t}=h(j),c=L(),e=T(()=>(t.definition["x-mcp"]?.resources||[]).find(a=>a.name===i),[t,i]),r=T(()=>e?v(e.security,t):null,[t,e]);return e?o(w,{children:o(D,{uriTitle:c("openapi.mcp.uriTitle","Resource URI"),mimeTypeTitle:c("openapi.mcp.mimeTypeTitle","Resource MIME type"),exampleTitle:c("openapi.mcp.exampleTitle","Resource content"),uri:e.uri,mimeType:e.mimeType,content:e.blob??e.text??"",children:r&&o(V,{securities:r})})}):l("div",{children:["Resource not found: ",i]})}function D({uriTitle:i,mimeTypeTitle:t,exampleTitle:c,uri:e,mimeType:r,content:p,children:a}){const m=h(I),d=m===R.STACKED,[u,f]=M.useState(null),y=async(n,x,C)=>{C.stopPropagation();try{await navigator.clipboard.writeText(n),f(x),setTimeout(()=>f(null),2e3)}catch(g){console.error("Failed to copy text: ",g)}};return l(K,{layout:m,children:[o(N,{isStacked:d,children:l("div",{children:[a,l("p",{children:[i,":"," ",o(S,{onClick:n=>y(e,"uri",n),title:"Click to copy",children:u==="uri"?"\u2713 Copied!":e})]}),l("p",{children:[t,":"," ",o(S,{onClick:n=>y(r,"mimeType",n),title:"Click to copy",children:u==="mimeType"?"\u2713 Copied!":r})]})]})}),p&&o(F,{isStacked:d,children:o(E,{className:"panel-response-samples",header:c,children:o(U,{source:p,header:{title:r,controls:{copy:{}}}})})})]})}const K=s(A)`
|
|
2
|
-
margin: calc(var(--spacing-unit) * 2) 0;
|
|
3
|
-
|
|
4
|
-
& + & {
|
|
5
|
-
margin-top: calc(var(--spacing-base) * 2);
|
|
6
|
-
}
|
|
7
|
-
`,N=s(B)`
|
|
8
|
-
padding-left: 0;
|
|
9
|
-
`,oe=k(_),S=s(P)`
|
|
10
|
-
text-transform: none;
|
|
11
|
-
`,U=s(b)`
|
|
12
|
-
border: none;
|
|
13
|
-
padding: 0 8px;
|
|
14
|
-
`;export{oe as McpResource};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as i}from"react/jsx-runtime";import t from"styled-components";import{GlobalStyle as a}from"@redocly/theme/core/openapi";function f({description:o}){return console.error(o),r(i,{children:[e(a,{}),r(n,{children:[e(l,{children:";("}),e(s,{children:"Something went wrong..."}),r(g,{children:["Please check the console for get more details or"," ",e("a",{target:"_blank",rel:"noopener noreferrer",href:"https://redocly.com/docs/redoc",children:"documentation"}),"."]})]})]})}const n=t.div`
|
|
2
|
-
height: 100vh;
|
|
3
|
-
max-width: var(--page-404-max-width);
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
margin: var(--page-404-margin-vertical) var(--page-404-margin-horizontal);
|
|
8
|
-
font-family: var(--page-404-font-family);
|
|
9
|
-
gap: var(--page-404-gap);
|
|
10
|
-
`,l=t.div`
|
|
11
|
-
color: var(--page-404-status-text-color);
|
|
12
|
-
font-size: var(--page-404-status-font-size);
|
|
13
|
-
line-height: var(--page-404-status-line-height);
|
|
14
|
-
font-weight: var(--page-404-status-font-weight);
|
|
15
|
-
`,s=t.div`
|
|
16
|
-
color: var(--page-404-title-text-color);
|
|
17
|
-
font-size: var(--page-404-title-font-size);
|
|
18
|
-
line-height: var(--page-404-title-line-height);
|
|
19
|
-
font-weight: var(--page-404-title-font-weight);
|
|
20
|
-
`,g=t.div`
|
|
21
|
-
color: var(--page-404-description-text-color);
|
|
22
|
-
font-size: var(--page-404-description-font-size);
|
|
23
|
-
line-height: var(--page-404-description-line-height);
|
|
24
|
-
font-weight: var(--page-404-description-font-weight);
|
|
25
|
-
`;export{f as ErrorPage};
|