@redocly/openapi-docs 3.16.0-next.0 → 3.16.0-next.10
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 +3139 -2687
- package/lib/components/ContentItem/ContentItem.js +1 -1
- package/lib/components/McpTool/McpPrompt.d.ts +6 -0
- package/lib/components/McpTool/McpPrompt.js +9 -0
- package/lib/components/McpTool/McpResource.d.ts +7 -0
- package/lib/components/McpTool/McpResource.js +16 -0
- package/lib/components/McpTool/McpTool.d.ts +1 -1
- package/lib/components/McpTool/McpTool.js +1 -1
- package/lib/components/McpTool/index.d.ts +2 -0
- package/lib/components/McpTool/index.js +1 -1
- package/lib/components/PropertyDetails/FieldDetails.js +6 -6
- package/lib/components/RedoclyOpenAPIDocs/Providers.js +1 -1
- package/lib/components/Replay/EmbeddedReplay.d.ts +2 -1
- package/lib/components/Replay/EmbeddedReplay.js +3 -3
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/Replay/utils.js +1 -1
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/Schema/OneOfSchema.js +3 -3
- package/lib/components/Schema/Schema.js +1 -1
- package/lib/components/ServerListDropdown/ServerListDropdown.js +1 -1
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/TagItem/OperationNavigationItems.js +4 -4
- package/lib/components/TagItem/OperationsNavigation.js +2 -2
- package/lib/models/group.js +1 -1
- package/lib/models/mediaType.js +1 -1
- package/lib/models/operation.js +1 -1
- package/lib/models/types.d.ts +4 -0
- package/lib/services/OpenAPIParser.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib/services/menu/operation.js +1 -1
- package/lib/services/menu/tags.d.ts +1 -0
- package/lib/services/menu/tags.js +4 -2
- package/lib/services/types.d.ts +3 -1
- package/lib/types/open-api.d.ts +8 -0
- package/lib/utils/configure-helpers.d.ts +2 -2
- package/lib/utils/configure-helpers.js +1 -1
- package/lib/utils/menu.js +1 -1
- package/package.json +13 -10
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import{getTagOrGroup as d}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as
|
|
2
|
-
|
|
1
|
+
import{getTagOrGroup as d}from"../../models/group.js";import{DEFAULT_WEBHOOKS_TAG_NAME as g,GROUP_DEPTH as h}from"../../constants.js";import{getValueFromMdParsedExtension as T,isOperationName as S,JsonPointer as w,safeSlugify as k}from"../../utils/index.js";import{getOperationsItems as x}from"./operation.js";import{addMarkdownItems as O}from"./markdown.js";import{joinWithSeparator as b}from"../history/helpers.js";const y=["tools","resources","prompts"];function v(r,f,n,o,s){let t;if(o===void 0?t=Object.keys(f):t=o.tags,!Array.isArray(t))return console.warn("Unexpected values of tags. Check tags or x-tagGroups in your definition."),[];const a=t.map(e=>f[e]?(f[e].used=!0,f[e]):(console.warn(`Non-existing tag "${e}" is added to the group "${o?.name}"`),null)),i=[];for(const e of a){if(!e)continue;const c=d("tag",e,n);if(c.depth=h+1,e.name===""){const m=[...O(T(e,"description")||"",c,c.depth+1),...x(void 0,e,c.depth+1)];i.push(...m);continue}const p=A({definition:r.definition,tag:e,parent:c,schemaDefinitionsTagName:s.schemaDefinitionsTagName}),l=E(r.definition,e,c);c.items=[...p,...l,...O(T(e,"description")||"",c,c.depth+1),...x(c,e,c.depth+1)],i.push(c)}return i.filter(({name:e,items:c})=>e!==g||c.length>0)}function I(r,f,n,o,s){const t=[];for(const a of n){const i=d("group",a,f);i.depth=h,i.items=v(r,o,i,a,s),t.push(i)}return t}function A({definition:r,tag:f,parent:n,schemaDefinitionsTagName:o}){const s=o?[o]:[];return Object.entries(r.components?.schemas||{}).map(([t,a])=>{if(!(a["x-tags"]||s).includes(f.name))return null;const e=d("schema",{name:t,"x-displayName":`${a.title||t}`,description:`{% schemaDefinition showWriteOnly="true" schemaRef="#/components/schemas/${t}" /%}`,isSchema:!0,level:2},n);return e.depth=n.depth+1,e}).filter(Boolean)}function E(r,f,n){const o=[];for(const s of y)if(r["x-mcp"]?.[s]){const t=P(s),a=[t];for(const i of r["x-mcp"]?.[s]||[])if((i.tags?.length?i.tags:a).includes(f.name)){const c=b(n.id,k(i.name)),p=s==="tools"?`Tool name: \`${i.name}\`
|
|
2
|
+
|
|
3
|
+
`:"",m=d(s==="tools"?"tool":s==="resources"?"rsrc":"prompt",{name:i.name,"x-displayName":i.title||i.name,description:`${p}${i.description||""}
|
|
4
|
+
{% mcp${t.slice(0,-1)} name="${i.name}" id="${c}" /%}`,isSchema:!0,level:2},n);m.depth=n.depth+1,o.push(m)}}return o}function M(r,f){const{definition:n}=r,o={},s=n["x-webhooks"]||n.webhooks,t=n["x-mcp"];for(const a of f||[])o[a.name]={...a,operations:[]};return n.paths&&u(r,n.paths,o),s&&u(r,s,o,!0),t&&j(t,o),o}function j(r,f){for(const n of y)if(r[n])for(const o of r[n]){const s=o.tags&&o.tags.length?o.tags:[P(n)];for(const t of s){let a=f[t];a===void 0&&(a={name:t,operations:[],used:!0},f[t]=a)}}}function $(r,f,n,o,s,t,a,i){if(s.$ref){const{resolved:c}=r.deref(s);u(r,{[o]:c},t,a);return}let e=n?.tags;(!e||!e.length)&&(e=a?[g]:[""]);for(const c of e){let p=t[c];p===void 0&&(p={name:c,operations:[]},t[c]=p),!p["x-traitTag"]&&p.operations.push({...n,pathName:o,pointer:w.compile(["paths",o,f]),httpVerb:f,pathParameters:s.parameters||[],pathServers:s.servers,isWebhook:!!a,isAdditionalOperation:!!i,keywords:n["x-keywords"]})}}function u(r,f,n,o){for(const s of Object.keys(f||{})){const t=f[s],a=Object.keys(t).filter(S);for(const i of a){const e=t[i];$(r,i,e,s,t,n,o)}if(t.additionalOperations)for(const[i,e]of Object.entries(t.additionalOperations))$(r,i,e,s,t,n,o,!0)}}function P(r){return r.charAt(0).toUpperCase()+r.slice(1)}export{P as capitalize,I as getTagGroupsItems,v as getTagsItems,M as getTagsWithOperations,$ as processOperation};
|
package/lib/services/types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type ExternalLinkSeparator = {
|
|
|
17
17
|
separator?: string;
|
|
18
18
|
separatorLine?: boolean;
|
|
19
19
|
};
|
|
20
|
-
export type MenuItemGroupType = 'group' | 'tag' | 'section' | 'schema' | '
|
|
20
|
+
export type MenuItemGroupType = 'group' | 'tag' | 'section' | 'schema' | 'tool' | 'rsrc' | 'prompt';
|
|
21
21
|
export type MenuItemType = MenuItemGroupType | 'operation';
|
|
22
22
|
/** Generic interface for MenuItems */
|
|
23
23
|
export interface IMenuItem {
|
|
@@ -29,6 +29,7 @@ export interface IMenuItem {
|
|
|
29
29
|
items: IMenuItem[];
|
|
30
30
|
parent?: IMenuItem;
|
|
31
31
|
deprecated?: boolean;
|
|
32
|
+
isAdditionalOperation?: boolean;
|
|
32
33
|
type: MenuItemType;
|
|
33
34
|
isSchema?: boolean;
|
|
34
35
|
httpVerb?: string;
|
|
@@ -50,6 +51,7 @@ export type ExtendedOpenAPIOperation = {
|
|
|
50
51
|
pathParameters: Array<Referenced<OpenAPIParameter>>;
|
|
51
52
|
pathServers: Array<OpenAPIServer> | undefined;
|
|
52
53
|
isWebhook: boolean;
|
|
54
|
+
isAdditionalOperation: boolean;
|
|
53
55
|
defaultSampleName?: string | false;
|
|
54
56
|
keywords?: unknown;
|
|
55
57
|
} & OpenAPIOperation;
|
package/lib/types/open-api.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface OpenAPIDefinition {
|
|
|
16
16
|
name: string;
|
|
17
17
|
tags: Array<string>;
|
|
18
18
|
}>;
|
|
19
|
+
'x-redocly-catalog-key'?: string;
|
|
19
20
|
'x-feedback'?: any;
|
|
20
21
|
'x-schema-catalog-link'?: string;
|
|
21
22
|
'x-keywords'?: unknown;
|
|
@@ -81,6 +82,7 @@ export interface OpenAPIPath extends Partial<OpenAPIRef>, ParsedDescriptionWithS
|
|
|
81
82
|
head?: OpenAPIOperation;
|
|
82
83
|
patch?: OpenAPIOperation;
|
|
83
84
|
trace?: OpenAPIOperation;
|
|
85
|
+
additionalOperations?: Record<string, OpenAPIOperation>;
|
|
84
86
|
servers?: OpenAPIServer[];
|
|
85
87
|
parameters?: Array<Referenced<OpenAPIParameter>>;
|
|
86
88
|
}
|
|
@@ -418,6 +420,8 @@ export interface McpResource {
|
|
|
418
420
|
description?: string;
|
|
419
421
|
uri: string;
|
|
420
422
|
mimeType: string;
|
|
423
|
+
blob?: string;
|
|
424
|
+
text?: string;
|
|
421
425
|
security?: OpenAPISecurityRequirement[];
|
|
422
426
|
tags?: string[];
|
|
423
427
|
'x-badges'?: OpenAPIXBadges[];
|
|
@@ -427,9 +431,13 @@ export interface McpPrompt {
|
|
|
427
431
|
title?: string;
|
|
428
432
|
description: string;
|
|
429
433
|
arguments: McpPromptArgument[];
|
|
434
|
+
security?: OpenAPISecurityRequirement[];
|
|
435
|
+
tags?: string[];
|
|
436
|
+
'x-badges'?: OpenAPIXBadges[];
|
|
430
437
|
}
|
|
431
438
|
export interface McpPromptArgument {
|
|
432
439
|
name: string;
|
|
433
440
|
description: string;
|
|
434
441
|
required: boolean;
|
|
442
|
+
example?: string;
|
|
435
443
|
}
|
|
@@ -3,10 +3,10 @@ import type { ConfigureRequestValues, ConfigureServerRequestValues, SecurityDeta
|
|
|
3
3
|
export declare function updateOperationWithRequestValues(operation: OperationModel, userDefinedRequestValues: ConfigureRequestValues | ConfigureServerRequestValues): void;
|
|
4
4
|
export declare function updateParametersWithUserValues(param: FieldModel, userDefinedRequestValues?: ConfigureRequestValues | ConfigureServerRequestValues): void;
|
|
5
5
|
export declare function updateRequestBodyWithUserValues(operation: OperationModel, userDefinedRequestValues: ConfigureRequestValues, serverUrl?: string): OperationModel | undefined;
|
|
6
|
-
export declare function updateSecurityWithUserValues(operation: OperationModel, securityValues?:
|
|
6
|
+
export declare function updateSecurityWithUserValues(operation: OperationModel, securityValues?: Record<string, SecurityDetails>, serverUrl?: string): void;
|
|
7
7
|
export declare function updateOperationWithServerUserValues(operation: OperationModel, serverRequestValues: ConfigureServerRequestValues): void;
|
|
8
8
|
export declare function updateEnvVariablesWithUserValues(operation: OperationModel, environmentValues?: Record<string, string>, serverUrl?: string): void;
|
|
9
9
|
export declare function updateServerVariablesWithUserValues(operation: OperationModel, serverVariables?: Record<string, string>, serverUrl?: string): void;
|
|
10
10
|
export declare function isDirectRequestValues(value: any): value is ConfigureRequestValues;
|
|
11
11
|
export declare function updateObjectProperties(original: any, updates: any): any;
|
|
12
|
-
export declare function createSecurityUpdates(scheme: any, securityValues: SecurityDetails): SecurityCredentials;
|
|
12
|
+
export declare function createSecurityUpdates(scheme: any, securityValues: Record<string, SecurityDetails>): SecurityCredentials;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as
|
|
1
|
+
import{isObject as k}from"@redocly/theme/core/openapi";function p(e,r){Object.keys(r).length!==0&&(h(r)?(b(e,r),y(e,r.security),d(e,r.envVariables),v(e,r.serverVariables)):j(e,r))}function O(e,r){if(!r)return;const{in:s,name:t}=e;if(h(r)){const a=r,c={header:a.headers,query:a.query,path:a.path,cookie:a.cookie};s&&c[s]?.[t]&&(e.example=c[s][t])}else Object.entries(r).forEach(([a,c])=>{const f=c;if(!f)return;const n={header:f.headers,query:f.query,path:f.path,cookie:f.cookie};s&&n[s]?.[t]&&(e.serverValues||(e.serverValues={}),e.serverValues[a]={example:n[s][t]})})}function b(e,r,s){if(!e.requestBody||!r?.body)return;const t=e.requestBody.content;if(!t?.mediaTypes)return;const a=(c,f)=>{c[f]&&Object.keys(c[f]).forEach(n=>{const o=c[f]?.[n]?.value;let l;if(k(o)?l=u(o,r.body):l=r.body,!!l)if(s){const i=c[f][n];i.serverValues||(i.serverValues={}),i.serverValues[s]={value:l,rawValue:l},c[f][n]={...i,mime:c.name}}else c[f][n]={value:l,rawValue:l,mime:c.name}})};for(const c of t.mediaTypes)a(c,"examples"),a(c,"formExamples");return e}function y(e,r,s){!r||!e.security.length||e.security.forEach(t=>{s?t.schemes.forEach(a=>{a.serverValues||(a.serverValues={});const c=V(a,r);a.serverValues[s]=c}):t.schemes.forEach(a=>{const c=V(a,r);Object.assign(a,c)})})}function j(e,r){e.servers.forEach(s=>{if(r[s.url]){const t=r[s.url];t&&(b(e,t,s.url),y(e,t.security,s.url),d(e,t.envVariables,s.url),v(e,t.serverVariables,s.url))}})}function d(e,r,s){!r||Object.keys(r).length===0||(e.envVariables||(e.envVariables={}),s?(e.envVariables.serverValues||(e.envVariables.serverValues={}),e.envVariables.serverValues[s]={...e.envVariables.serverValues[s],...r}):e.envVariables.values={...e.envVariables.values,...r})}function v(e,r,s){if(!(!r||Object.keys(r).length===0))if(s){const t=e.servers.find(a=>a.url===s);if(t){t.variables||(t.variables={});for(const[a,c]of Object.entries(r))t.variables[a]&&(t.variables[a].default=c)}}else e.servers.forEach(t=>{t.variables||(t.variables={});for(const[a,c]of Object.entries(r))t.variables[a]&&(t.variables[a].default=c)})}function h(e){return!e||typeof e!="object"?!1:"headers"in e||"body"in e||"query"in e||"path"in e||"cookie"in e||"security"in e||"envVariables"in e||"serverVariables"in e}function u(e,r){if(!e||typeof e!="object")return r;if(Array.isArray(e)&&Array.isArray(r)){if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const t=Object.keys(e[0]),a=r.filter(c=>typeof c!="object"||c===null?!1:t.some(f=>f in c)&&Object.keys(c).every(f=>t.includes(f)));return a.length>0?a:e}return r}const s=Array.isArray(e)?[...e]:{...e};for(const[t,a]of Object.entries(r))t in e&&(Array.isArray(e[t])||typeof a=="object"&&a!==null&&typeof e[t]=="object"?s[t]=u(e[t],a):s[t]=a);return s}function V(e,r){const s=r?.[e.id]||r?.default||{},t={"x-defaultAccessToken":s.token?.access_token,"x-defaultTokenType":s.token?.token_type||"Bearer","x-defaultClientId":s.client_id,"x-defaultClientSecret":s.client_secret,scopes:s.scopes||e.scopes};return e.type==="http"&&e.scheme==="basic"?(t["x-defaultUsername"]=s.username,t["x-defaultPassword"]=s.password,delete t["x-defaultAccessToken"],delete t["x-defaultTokenType"]):e.type==="oauth2"&&!s.token?.access_token&&(delete t["x-defaultAccessToken"],delete t["x-defaultTokenType"]),t}export{V as createSecurityUpdates,h as isDirectRequestValues,d as updateEnvVariablesWithUserValues,u as updateObjectProperties,p as updateOperationWithRequestValues,j as updateOperationWithServerUserValues,O as updateParametersWithUserValues,b as updateRequestBodyWithUserValues,y as updateSecurityWithUserValues,v as updateServerVariablesWithUserValues};
|
package/lib/utils/menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function p(e){return e.type==="operation"||e.type==="schema"||e.type==="tool"||e.type==="rsrc"||e.type==="prompt"}export{p as isRenderableMenuItem};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.16.0-next.
|
|
3
|
+
"version": "3.16.0-next.10",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "2.
|
|
24
|
+
"@redocly/openapi-core": "2.12.1",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.7",
|
|
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.19.0-next.
|
|
39
|
+
"@redocly/config": "0.40.0",
|
|
40
|
+
"@redocly/replay": "0.19.0-next.9"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
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": "5.
|
|
57
|
-
"esbuild": "0.
|
|
56
|
+
"@vitejs/plugin-react": "5.1.1",
|
|
57
|
+
"esbuild": "0.27.0",
|
|
58
58
|
"jest": "29.5.0",
|
|
59
59
|
"jest-environment-jsdom": "29.5.0",
|
|
60
60
|
"jest-styled-components": "7.2.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": "7.
|
|
78
|
-
"@redocly/theme": "0.60.0-next.
|
|
77
|
+
"vite": "7.2.6",
|
|
78
|
+
"@redocly/theme": "0.60.0-next.7"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"start": "npm run copy-highlight-hook && vite",
|
|
@@ -86,7 +86,8 @@
|
|
|
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
88
|
"apply:community-source": "npx tsx scripts/apply-changes-from-community-source.ts",
|
|
89
|
-
"test": "jest -w 2",
|
|
89
|
+
"test": "npm run prepare:community-source && npm run test:redoc && jest -w 2",
|
|
90
|
+
"test:redoc": "cd redoc && pnpm install && npm run lint && npm run unit",
|
|
90
91
|
"unit": "jest -w 2",
|
|
91
92
|
"test:update": "jest -u",
|
|
92
93
|
"test:watch": "jest --watch",
|
|
@@ -100,6 +101,8 @@
|
|
|
100
101
|
"license:check": "npx license-checker --production --onlyAllow 'MIT;ISC;Apache-2.0;Apache;CC0-1.0;BSD;BSD-2-Clause;BSD-3-Clause;UNKNOWN' --summary",
|
|
101
102
|
"precdn:serve": "mkdir -p playground/cdn-test/server-dist && cp -Rf dist/* playground/cdn-test/server-dist && cp -Rf playground/cdn-test/template-source/* playground/cdn-test/server-dist",
|
|
102
103
|
"cdn-serve": "http-server playground/cdn-test/server-dist",
|
|
103
|
-
"copy-highlight-hook": "cp -r ../portal/src/client/app/hooks/codeHighlight ./playground/hooks"
|
|
104
|
+
"copy-highlight-hook": "cp -r ../portal/src/client/app/hooks/codeHighlight ./playground/hooks",
|
|
105
|
+
"redoc:use-workspace": "node scripts/use-workspace-deps.js",
|
|
106
|
+
"redoc:revert-workspace": "node scripts/use-workspace-deps.js revert"
|
|
104
107
|
}
|
|
105
108
|
}
|