@redocly/redoc-revel 0.139.0-next.1 → 0.139.0-next.3
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/CHANGELOG.md +27 -0
- package/dist/client/app/markdoc/custom-components/openapi/openapi-example.js +1 -1
- package/dist/client/app/search/useSearch.js +1 -1
- package/dist/client/templates/api-docs/template.js +8 -8
- package/dist/server/config/env-schemas/feature-flags.d.ts +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @redocly/redoc-revel
|
|
2
2
|
|
|
3
|
+
## 0.139.0-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b07968f01e6: Fixed an issue in OpenAPI docs where the samples panel displayed a variant dropdown that had no effect on schemas with an `example` and a nested `oneOf` or `anyOf`.
|
|
8
|
+
- e3bbc9190a3: Updated `@redocly/openapi-core` to version `2.63.0`.
|
|
9
|
+
- 4e08c72bec8: Fixed an issue where Reunite project analytics displayed the number of result categories instead of the number of results for each search query.
|
|
10
|
+
- Updated dependencies [b07968f01e6]
|
|
11
|
+
- Updated dependencies [e3bbc9190a3]
|
|
12
|
+
- @redocly/api-docs@0.4.0-next.3
|
|
13
|
+
- @redocly/portal-plugin-mock-server@0.24.0-next.0
|
|
14
|
+
|
|
15
|
+
## 0.139.0-next.2
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 229406a7c50: Added support for the `encoding` object of `multipart/form-data` bodies in OpenAPI code samples and **Try It**.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 01e8f8211cf: Fixed an issue in API docs where links to sections of the API description didn't scroll to the section on projects with a path prefix.
|
|
24
|
+
- c836c43c6a9: Fixed an issue in AsyncAPI docs where the **Payload** panel displayed examples from all channel messages on initial page load.
|
|
25
|
+
- Updated dependencies [229406a7c50]
|
|
26
|
+
- Updated dependencies [01e8f8211cf]
|
|
27
|
+
- Updated dependencies [c836c43c6a9]
|
|
28
|
+
- @redocly/api-docs@0.4.0-next.2
|
|
29
|
+
|
|
3
30
|
## 0.139.0-next.1
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{MarkdownAdapterProvider as
|
|
1
|
+
import*as e from"react";import{MarkdownAdapterProvider as c,RedocExample as l,StoreProvider as E,findExampleEncoding as f,markdocParser as u}from"@redocly/api-docs";import{ErrorMessage as k,OpenApiComponentWrap as x}from"../styled.elements";import{useStore as A}from"../../hooks/use-store";import{usePortalMarkdownAdapter as P}from"./use-markdown-adapter";function S(n){const{descriptionFile:i,pointer:o,options:p,mimeType:a}=n,{store:r,error:m}=A(i),s=P(),t=r?.items,d=e.useMemo(()=>t?f(t,o):void 0,[t,o]);return r?e.createElement(x,{"data-testid":"openapi-example"},e.createElement(E,{options:{...r.options,...p,markdownParser:u},apiStore:r.store},e.createElement(c,{value:s},e.createElement(l,{pointer:o,mimeType:a||"application/json",encoding:d})))):e.createElement(k,null,m)}export{S as OpenApiExample};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as v,useEffect as D,useMemo as L,useState as S,useRef as A}from"react";import{SEARCH_DEBOUNCE_TIME_MS as U}from"@redocly/theme/core/constants";import{getBaseDataAttributes as B,withPathPrefix as H}from"@redocly/theme/core/utils";import{ServerRoutes as T}from"../../../constants/api";import{SEARCH_GROUP_FACET_FIELD as j,SEARCH_PRODUCT_FIELD as J,SEARCH_VERSION_FIELD as K}from"../../../constants/common";import{debounce as $}from"../../../utils/time/debounce.js";import{useSearchSession as z}from"@redocly/theme/core/contexts";import{useGlobalData as k,useI18nConfig as x}from"../hooks";import{usePageVersions as W}from"../../providers/page-data/hooks";import{useFacets as X}from"./useFacets";import{telemetry as Y}from"../telemetry/index.js";const Z=(n,u,r,l,R,s,F,i,o,d)=>{const{searchSessionId:g}=z(),{currentLocale:E}=x(),f=A(""),p=A(null),h=A(async(e,a)=>{try{F(null);const t=await fetch(H(T.SEARCH),a);if(!t.ok)throw new Error(t.statusText||`Search failed (${t.status})`);if(C(e)){const c=await t.json();l(c.facets),r(c.documents),R(c.groupCounts??{}),p.current=null,e.trim().length>1&&Y.sendSearchQueryMessage([{...B("searchQuery","search"),query:e,resultCount:Object.values(c.documents).flat().length.toString(),searchSessionId:g,...o&&{product:o}}]),s(!1)}}catch(t){if(!C(e))return;p.current={query:e,requestParams:a},r({}),s(!1),F(t instanceof Error?t.message:"An unknown error occurred")}}),C=e=>f.current===e,m=L(()=>$(async(e,a,t,c)=>{if(!e.trim().length&&!a.length){r({}),l({}),R({}),s(!1),F(null),p.current=null;return}const y={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:e,filter:G(a,c,i),locale:t})};await h.current(e,y)},U),[i?.version,i?.folderId,o]);return D(()=>{d||(s(!0),m(n,u,E,o),f.current=n)},[d,u,E,o,n,m,s]),{retrySearch:v(async()=>{const e=p.current;e&&(s(!0),f.current=e.query,await h.current(e.query,e.requestParams))},[s])}},V=(n,u,r,l,R,s,F,i,o,d)=>{const{currentLocale:g}=x();D(()=>{E(r,n,u,g,l,R,o,d)},[l,o,d?.version,d?.folderId]);const E=v(async(f,p,h,C,m,b,e,a)=>{if(m){const{groupKey:t}=m;i(!0);const y={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:p,filter:(()=>{const I=b.find(O=>O.field===j);let _=h;return I&&(h.find(q=>q.field===I.field)||(_=[...h,{field:I.field,values:[t]}])),G(_,e,a)})(),loadMore:m,locale:C})},w=await(await fetch(H(T.SEARCH),y)).json(),M=f[t]||[],N=w.documents[t]??[],Q={...f,[t]:[...M,...N]};s(Q),w.groupCounts&&F(I=>({...I,...w.groupCounts})),i(!1)}},[]);return{}};function fe(){const{searchFeatures:n}=k();return{askAi:n?.ai?.enabled}}function me(n,u){const{searchFeatures:r}=k(),[l,R]=S(""),[s,F]=S([]),[i,o]=S({}),[d,g]=S({}),[E,f]=S({}),[p,h]=S(),[C,m]=S(!1),[b,e]=S(null),{facets:a}=X(d),{versions:t=[]}=W()||{},c=t.find(P=>P?.active),{retrySearch:y}=Z(l,s,o,g,f,m,e,c,n,u);return V(l,s,i,p,a,o,f,m,n,c),{query:l,setQuery:R,filter:s,setFilter:F,items:i,isSearchLoading:C,searchError:b,facets:a,groupCounts:E,groupField:j,setLoadMore:h,retrySearch:y,advancedSearch:r?.advanced?.enabled,askAi:r?.ai?.enabled}}function G(n,u,r){return[...n,...u?[{field:J,values:[u]}]:[],...r?[{field:K,values:[...r.default?["default"]:[r.folderId,r.version]]}]:[]]}export{me as useSearch,fe as useSearchFeatures};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import*as e from"react";import{useMemo as i}from"react";import A from"styled-components";import{RedoclyApiDocs as
|
|
1
|
+
import*as e from"react";import{useMemo as i}from"react";import A from"styled-components";import{RedoclyApiDocs as O,createMarkdocAdapter as _}from"@redocly/api-docs";import{LayoutVariant as T}from"@redocly/theme/components/SidebarActions/SidebarActions";import{ThreePanelLayout as x}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as B}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{Breadcrumbs as U}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{withPathPrefix as s}from"@redocly/theme/core/utils";import{usePageSharedData as D,useUserClaims as I}from"../../app/hooks";import{ServerRoutes as p}from"../../../constants/api.js";import{isBrowser as M}from"../../../utils/env/is-browser.js";import{CLIENT_TELEMETRY_ENABLED as $}from"../../constants/common.js";import{PACKAGE_NAME as N}from"../../../config/product-gates";import{applyPathPrefixToApiItems as H,safeParseFunction as Y,useCollectMarkdocOptions as V}from"./helpers";function W({pageProps:{markdown:c,apiOptions:f,metadata:R}}){const u=D("apiDocsStore"),{items:l,options:o,store:v,baseSlug:r}=u,a=M(),g=I(),n=V(c,o.markdocOptions),d=i(()=>s(r),[r]),w=i(()=>d===r?l:H(l),[l,r,d]),y=i(()=>_(n,o),[n,o]),C=i(()=>{const L=a?`${window.location.origin}${s(p.REPLAY_OAUTH2_CALLBACK)}`:void 0;let m=o.corsProxyUrl;if(m===void 0){const t=s(`${p.CORS_PROXY}/`);m=a?new URL(t,window.location.origin).toString():t}const E=o.events,h=E?Object.entries(E).reduce((t,[S,b])=>{const P=Y(b);return P&&(t[S]=P),t},{}):void 0;return{...o,markdocOptions:n,oAuth2RedirectURI:L,corsProxyUrl:m,userClaims:g,...h&&{events:h},unstable_hooks:{...o.unstable_hooks,MiddlePanelHeader:()=>e.createElement(U,null)}}},[o,n,a,g]);if(!u)return e.createElement("div",null,"Something went wrong");const k=a?{collectorUrl:new URL(s(p.OTEL_TRACES),window.location.origin).toString(),disabled:!$,serviceVersion:`${N}@${process.env.REDOCLY_PORTAL_VERSION}`}:void 0;return e.createElement(K,null,e.createElement(z,{layout:f?.layout},e.createElement(B,{metadata:R})),e.createElement(O,{items:w,store:v,basePath:d,options:C,markdownAdapter:y,layout:f?.layout,telemetryConfig:k}))}const z=A(x)`
|
|
2
2
|
&& {
|
|
3
|
-
padding-right: ${({layout:c})=>c===
|
|
3
|
+
padding-right: ${({layout:c})=>c===T.THREE_PANEL?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* Hide the catalog info block (scorecard badge) when api-docs renders its 404 or error fallback page. */
|
|
7
|
+
&:has(~ .not-found-page, ~ .api-docs-error-page) {
|
|
8
|
+
display: none;
|
|
4
9
|
}
|
|
5
10
|
`,K=A.main`
|
|
6
11
|
div[id],
|
|
@@ -15,9 +20,4 @@ import*as e from"react";import{useMemo as i}from"react";import A from"styled-com
|
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
--sidebar-width: 0px;
|
|
18
|
-
|
|
19
|
-
/* Hide the catalog info block (scorecard badge) when api-docs renders its 404 or error fallback page. */
|
|
20
|
-
&:has(.not-found-page, .api-docs-error-page) ${R} {
|
|
21
|
-
display: none;
|
|
22
|
-
}
|
|
23
|
-
`;export{z as default};
|
|
23
|
+
`;export{W as default};
|
|
@@ -15,7 +15,7 @@ export declare const featureFlagsSchema: z.ZodObject<{
|
|
|
15
15
|
REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL: z.ZodOptional<z.ZodString>;
|
|
16
16
|
/** (Optional) API endpoint for the agent feedback endpoint;**/
|
|
17
17
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT: z.ZodOptional<z.ZodString>;
|
|
18
|
-
/** Experimental: enables the GraphQL request body in Try It and embedded Replay. */
|
|
18
|
+
/** Experimental: enables the GraphQL request body in Try It and embedded Replay, and shows Try it on GraphQL operation pages. */
|
|
19
19
|
REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
|
|
20
20
|
}, "strip", z.ZodTypeAny, {
|
|
21
21
|
NEW_CATALOG_ENABLED?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SEMANTIC_SEARCH_API_URL as g}from"../../../constants/common.js";import{shouldHandleMcpAuth as f}from"../../../utils/rbac/should-handle-mcp-auth.js";import{CREATE_ANONYMOUS_SESSION_TOOL_NAME as b,READ_ONLY_ANNOTATIONS as t,SUBMIT_FEEDBACK_TOOL_NAME as A}from"../constants.js";import{GRAPHQL_TYPE_KINDS as c,GRAPHQL_LIST_SCOPES as P}from"./tools/graphql/constants.js";import{OPERATION_METHODS as h}from"./tools/openapi/constants.js";const n={type:"string",nullable:!0},a={limit:{type:"number"},total:{type:"number"},page:{type:"number"},totalPages:{type:"number"}},o={codemodeType:"OpenApiServer[]"},p={codemodeType:"OpenApiSecurityRequirement[]"},u={codemodeType:"Record<string, OpenApiSecurityScheme>"},v={codemodeType:"OpenApiDocument"},S={codemodeType:"OpenApiOperation & { path: string; method: string }"},L={codemodeType:"OpenApiComponents",description:"Components the endpoint references. A `$ref` in `endpoint` resolves against the root of the result."},r={filePath:{type:"string",description:"API definition file path"},otherMatches:{type:"array",description:"Other API definitions the lookup also matched. Present only when several matched; pass `filePath` to pick another one",items:{type:"object",required:["filePath"],properties:{version:{type:"string"},filePath:{type:"string"}}}}},s="When several definitions match the name, the highest version or the shortest file path is used and the rest are listed in `otherMatches`; tell the user which version or file the answer is based on.",q="A `$ref` in `endpoint` points into the `components` key at the root of the result: read `#/components/<section>/<name>` there.",T={type:"object",additionalProperties:!1,required:[],properties:{filter:{type:"string",description:"Matches part of an API name, or of a description when no name matches",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of APIs per page. Default is 300",minimum:1,default:300,nullable:!0}}},l={type:"object",required:[],additionalProperties:!1,properties:{name:{type:"string",description:"API name, or a unique part of it. Omit when `filePath` is given.",minLength:1,nullable:!0},apiName:{type:"string",description:"Alias of `name`",nullable:!0},api:{type:"string",description:"Alias of `name`",nullable:!0},version:{type:"string",description:"API version. When omitted and several versions exist, the highest one is used",nullable:!0},filePath:{type:"string",description:"API definition file path, as returned by `listApis`",nullable:!0}}},O={type:"object",required:["path","method"],additionalProperties:!1,properties:{name:{type:"string",description:"API name, or a unique part of it. Omit when `filePath` is given.",minLength:1,nullable:!0},apiName:{type:"string",description:"Alias of `name`",nullable:!0},api:{type:"string",description:"Alias of `name`",nullable:!0},path:{type:"string",description:"Endpoint path (e.g. /api/v1/users)",minLength:1},method:{type:"string",description:"HTTP method (GET, POST, PUT, DELETE, etc.)",enum:[...h.map(e=>e.toUpperCase()),...h],minLength:1},version:{type:"string",description:"API version. When omitted and several versions exist, the highest one is used",nullable:!0},filePath:{type:"string",description:"API definition file path, as returned by `listApis`",nullable:!0}}},G={type:"object",required:[],additionalProperties:!1,properties:{}},I={type:"object",required:[],additionalProperties:!1,properties:{}},w={type:"object",required:["path","summary"],additionalProperties:!1,properties:{path:{type:"string",description:"Path or URL of the documentation page the feedback is about (e.g. /guides/auth)",minLength:1,maxLength:1e3},summary:{type:"string",description:"One sentence that names what is wrong with the page",minLength:1,maxLength:500},details:{type:"string",description:"Expected versus actual behavior, missing steps, or the snippet that failed",maxLength:4e3,nullable:!0},targetFeature:{type:"string",description:"The API or feature the page documents",maxLength:500,nullable:!0}}};function j(e){const i=[{name:"list-apis",title:"List APIs",description:"Lists the APIs documented in this project",schema:T,annotations:t,outputSchema:{type:"object",required:["items","limit","total","page","totalPages"],properties:{items:{type:"array",items:{type:"object",required:["name","description","version","servers","filePath"],properties:{name:{type:"string"},description:{type:"string"},version:{type:"string"},servers:o,filePath:{type:"string",description:"API definition file path"},ambiguousTitle:{type:"boolean",description:"true = another API shares this title; a lookup picks the highest version, or the shortest file path at the same version, and lists the rest in `otherMatches`. Pass `filePath` to pick another one"},...e.hasCallableApis?{callable:{type:"boolean",description:"true = the documented hosts of this API are reachable via `fetch`; false = documentation only"}}:{}}}},...a}}},{name:"get-endpoints",title:"Get endpoints",description:`Get all endpoints for a specific API. ${s}`,schema:l,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","servers","endpoints"],properties:{api:{type:"string"},version:{type:"string"},...r,servers:o,endpoints:{type:"array",items:{type:"object",required:["path","method"],properties:{path:{type:"string"},method:{type:"string"},summary:n,description:n,security:p}}}}}},{name:"get-endpoint-info",title:"Get endpoint info",description:`Get comprehensive information about specific endpoint including parameters, security, and examples. ${q} ${s}`,schema:O,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","servers","endpoint","globalSecurity","securitySchemes"],properties:{api:{type:"string"},version:{type:"string"},...r,servers:o,endpoint:S,globalSecurity:p,securitySchemes:u,components:L}}},{name:"get-security-schemes",title:"Get security schemes",description:`Get the security schemes for a specific API. ${s}`,schema:l,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","securitySchemes","security"],properties:{api:{type:"string"},version:{type:"string"},...r,securitySchemes:u,security:p}}},{name:"get-full-api-description",title:"Get full API description",description:`Get the complete OpenAPI description. ${s}`,schema:l,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","definition"],properties:{api:{type:"string"},version:{type:"string"},...r,definition:v}}},...g?[m(e.products,e.locales)]:[]];return f(e.requiresLogin,e.rbac)&&i.push({name:"whoami",title:"Who am I",description:"Get information about the currently authenticated user",schema:G,annotations:t,outputSchema:{type:"object",required:["authenticated"],properties:{authenticated:{type:"boolean"},email:{type:"string"},name:{type:"string"},subject:{type:"string"},clientId:{type:"string"},scope:{type:"string"},issuedAt:{type:"string"},expiresAt:{type:"string"}}}}),e.feedbackHidden||i.push({name:A,title:"Submit feedback",description:"Report a documentation page that is wrong or incomplete",schema:w,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},outputSchema:{type:"object",required:["status","page","message"],properties:{status:{type:"string"},page:{type:"string"},message:{type:"string"}}}}),e.hasGraphqlApis&&i.push(...D()),e.elicitationEnabled&&e.hasCallableApis&&i.push({name:b,title:"Create anonymous session",description:"Create an anonymous session handle for storing upstream API credentials. Pass the returned sessionHandle to execute when an API needs credentials and the caller is not signed in. Treat it as a secret and reuse it across calls.",schema:I,annotations:t,outputSchema:{type:"object",required:["sessionHandle"],properties:{sessionHandle:{type:"string"}}}}),i}const E={type:"object",required:[],additionalProperties:!1,properties:{filter:{type:"string",description:"GraphQL schema name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},N={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},kind:{type:"string",description:'Optional: return only a single category of schema members. With scope "fields", restricts to the fields of that parent category ("objects", "interfaces", or "inputs" only).',enum:[...c,null],nullable:!0},scope:{type:"string",description:'Optional: what each list item is. "members" (default) lists top-level types and operations. "fields" flattens every field of every object/interface/input type into "ParentType.fieldName" entries with their descriptions \u2014 combine with `filter` to search nested fields anywhere in the schema.',enum:[...P,null],nullable:!0},filter:{type:"string",description:'Optional: only members whose name or description contains this substring, case-insensitive (e.g. "custom tags")',minLength:1,nullable:!0},referencesType:{type:"string",description:'Optional: only members that reference this type directly or transitively (via return, field, argument, union-member or input-field types). Finds cross-cutting members that never name it \u2014 e.g. referencesType "Book" surfaces a search query returning a union that includes Book.',minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},_={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},type:{type:"string",description:"Name of the type, operation, or directive",minLength:1,nullable:!0},typeName:{type:"string",description:"Alias of `type`",nullable:!0},includeReferencedTypes:{type:"boolean",description:"Also include the SDL of every type referenced transitively. Gives the whole subgraph at once, but can be large for highly-connected types.",default:!1,nullable:!0}}},k={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1}}};function D(){return[{name:"list-graphql-apis",title:"List GraphQL APIs",description:"Lists available GraphQL schemas with their context and purpose",schema:E,annotations:t,outputSchema:{type:"object",required:["items","limit","total","page","totalPages"],properties:{items:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string"},description:n}}},...a}}},{name:"get-graphql-type-list",title:"Get GraphQL type list",description:'List all operations and types in a GraphQL schema as a flat, paginated list. Each item is tagged with its kind (query, object, enum, \u2026) and carries a one-line description; operations also include their return type and argument signature \u2014 use it to decide which members to fetch in detail. Narrow the result with `kind` (one category), `filter` (case-insensitive substring of the member name or description, e.g. "book"), or `referencesType` (only members that use a given type, directly or transitively) to explore a domain cheaply instead of pulling the full schema. To search nested fields \u2014 not just type names \u2014 set scope "fields": it flattens every field of every object/interface/input type into "ParentType.fieldName" entries with their descriptions, so `filter` finds things like an input field whose docstring mentions your keyword.',schema:N,annotations:t,outputSchema:{type:"object",required:["name","items","limit","total","page","totalPages"],properties:{name:{type:"string"},items:{type:"array",items:{type:"object",required:["kind","name"],properties:{kind:{type:"string",enum:c},name:{type:"string"},description:n,type:{type:"string"},args:{type:"string"},directives:{type:"string"}}}},...a}}},{name:"get-graphql-type",title:"Get GraphQL type",description:'Get the SDL for a single GraphQL type, operation (query/mutation/subscription field), or directive. Without includeReferencedTypes, the SDL is followed by a one-level manifest of every directly referenced type\'s field names (e.g. "input ActionOperationInput { addTags, removeTags }"), so you can see what nested types contain before fetching them. Set includeReferencedTypes to instead pull in the full SDL of every type it references transitively \u2014 the whole structural subgraph in one call, ideal for complete exploration of an entity (e.g. Book and all the types it touches). That traversal only follows what the target depends on; to go the other direction and find the members that use a type, call get-graphql-type-list with `referencesType`.',schema:_,annotations:t,outputSchema:{type:"string"}},{name:"get-graphql-schema",title:"Get GraphQL schema",description:"Get the complete GraphQL schema as SDL \u2014 the whole type graph in one call. Returns everything, so it can be very large and token-expensive for big schemas; prefer get-graphql-type-list (filter/paginate) plus targeted get-graphql-type calls, and reach for this only for small schemas or when you truly need the full SDL.",schema:k,annotations:t,outputSchema:{type:"string"}}]}function m(e,i){const d=e&&e.length>0,y=i&&i.length>0;return{name:"search",title:"Search documentation",description:"Search across the documentation to fetch relevant content for a given query",schema:{type:"object",required:["query"],additionalProperties:!1,properties:{query:{type:"string",description:"Search query. Should be a single word or that phrase that is presented in a documentation.",minLength:1},...d?{product:{type:"string",description:"Optional product name to filter search results by specific product.",enum:[...e,null],nullable:!0}}:{},...y?{locale:{type:"string",description:"Optional locale code to filter search results by documentation language (e.g. 'en', 'ja'). Use the locale matching the language of the user's request. Defaults to the project's default locale.",enum:[...i,null],nullable:!0}}:{}}},annotations:t,outputSchema:{type:"string"}}}const M=new Set([...j({requiresLogin:!0,hasGraphqlApis:!0,elicitationEnabled:!0,hasCallableApis:!0}).map(e=>e.name),m().name]);export{M as ALL_DEFAULT_TOOL_NAMES,j as getDefaultToolSchemas};
|
|
1
|
+
import{SEMANTIC_SEARCH_API_URL as g}from"../../../constants/common.js";import{shouldHandleMcpAuth as f}from"../../../utils/rbac/should-handle-mcp-auth.js";import{CREATE_ANONYMOUS_SESSION_TOOL_NAME as b,READ_ONLY_ANNOTATIONS as t,SUBMIT_FEEDBACK_TOOL_NAME as A}from"../constants.js";import{GRAPHQL_TYPE_KINDS as c,GRAPHQL_LIST_SCOPES as P}from"./tools/graphql/constants.js";import{OPERATION_METHODS as h}from"./tools/openapi/constants.js";const n={type:"string",nullable:!0},a={limit:{type:"number"},total:{type:"number"},page:{type:"number"},totalPages:{type:"number"}},o={codemodeType:"OpenApiServer[]"},p={codemodeType:"OpenApiSecurityRequirement[]"},u={codemodeType:"Record<string, OpenApiSecurityScheme>"},v={codemodeType:"OpenApiDocument"},S={codemodeType:"OpenApiOperation & { path: string; method: string }"},L={codemodeType:"OpenApiComponents",description:"Components the endpoint references. A `$ref` in `endpoint` resolves against the root of the result."},r={filePath:{type:"string",description:"API definition file path"},otherMatches:{type:"array",description:"Other API definitions the lookup also matched. Present only when several matched; pass `filePath` to pick another one",items:{type:"object",required:["filePath"],properties:{version:{type:"string"},filePath:{type:"string"}}}}},s="When several definitions match the name, the highest version or the shortest file path is used and the rest are listed in `otherMatches`; tell the user which version or file the answer is based on.",q="A `$ref` in `endpoint` points into the `components` key at the root of the result: read `#/components/<section>/<name>` there.",T={type:"object",additionalProperties:!1,required:[],properties:{filter:{type:"string",description:"Matches part of an API name, or of a description when no name matches",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of APIs per page. Default is 300",minimum:1,default:300,nullable:!0}}},l={type:"object",required:[],additionalProperties:!1,properties:{name:{type:"string",description:"API name, or a unique part of it. Omit when `filePath` is given.",minLength:1,nullable:!0},apiName:{type:"string",description:"Alias of `name`",nullable:!0},api:{type:"string",description:"Alias of `name`",nullable:!0},version:{type:"string",description:"API version. When omitted and several versions exist, the highest one is used",nullable:!0},filePath:{type:"string",description:"API definition file path from the API list",nullable:!0}}},I={type:"object",required:["path","method"],additionalProperties:!1,properties:{name:{type:"string",description:"API name, or a unique part of it. Omit when `filePath` is given.",minLength:1,nullable:!0},apiName:{type:"string",description:"Alias of `name`",nullable:!0},api:{type:"string",description:"Alias of `name`",nullable:!0},path:{type:"string",description:"Endpoint path (e.g. /api/v1/users)",minLength:1},method:{type:"string",description:"HTTP method (GET, POST, PUT, DELETE, etc.)",enum:[...h.map(e=>e.toUpperCase()),...h],minLength:1},version:{type:"string",description:"API version. When omitted and several versions exist, the highest one is used",nullable:!0},filePath:{type:"string",description:"API definition file path from the API list",nullable:!0}}},O={type:"object",required:[],additionalProperties:!1,properties:{}},G={type:"object",required:[],additionalProperties:!1,properties:{}},w={type:"object",required:["path","summary"],additionalProperties:!1,properties:{path:{type:"string",description:"Path or URL of the documentation page the feedback is about (e.g. /guides/auth)",minLength:1,maxLength:1e3},summary:{type:"string",description:"One sentence that names what is wrong with the page",minLength:1,maxLength:500},details:{type:"string",description:"Expected versus actual behavior, missing steps, or the snippet that failed",maxLength:4e3,nullable:!0},targetFeature:{type:"string",description:"The API or feature the page documents",maxLength:500,nullable:!0}}};function j(e){const i=[{name:"list-apis",title:"List APIs",description:"Lists the APIs documented in this project",schema:T,annotations:t,outputSchema:{type:"object",required:["items","limit","total","page","totalPages"],properties:{items:{type:"array",items:{type:"object",required:["name","description","version","servers","filePath"],properties:{name:{type:"string"},description:{type:"string"},version:{type:"string"},servers:o,filePath:{type:"string",description:"API definition file path"},ambiguousTitle:{type:"boolean",description:"true = another API shares this title; a lookup picks the highest version, or the shortest file path at the same version, and lists the rest in `otherMatches`. Pass `filePath` to pick another one"},...e.hasCallableApis?{callable:{type:"boolean",description:"true = the documented hosts of this API are reachable via `fetch`; false = documentation only"}}:{}}}},...a}}},{name:"get-endpoints",title:"Get endpoints",description:`Get all endpoints for a specific API. ${s}`,schema:l,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","servers","endpoints"],properties:{api:{type:"string"},version:{type:"string"},...r,servers:o,endpoints:{type:"array",items:{type:"object",required:["path","method"],properties:{path:{type:"string"},method:{type:"string"},summary:n,description:n,security:p}}}}}},{name:"get-endpoint-info",title:"Get endpoint info",description:`Get comprehensive information about specific endpoint including parameters, security, and examples. ${q} ${s}`,schema:I,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","servers","endpoint","globalSecurity","securitySchemes"],properties:{api:{type:"string"},version:{type:"string"},...r,servers:o,endpoint:S,globalSecurity:p,securitySchemes:u,components:L}}},{name:"get-security-schemes",title:"Get security schemes",description:`Get the security schemes for a specific API. ${s}`,schema:l,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","securitySchemes","security"],properties:{api:{type:"string"},version:{type:"string"},...r,securitySchemes:u,security:p}}},{name:"get-full-api-description",title:"Get full API description",description:`Get the complete OpenAPI description. ${s}`,schema:l,annotations:t,outputSchema:{type:"object",required:["api","version","filePath","definition"],properties:{api:{type:"string"},version:{type:"string"},...r,definition:v}}},...g?[m(e.products,e.locales)]:[]];return f(e.requiresLogin,e.rbac)&&i.push({name:"whoami",title:"Who am I",description:"Get information about the currently authenticated user",schema:O,annotations:t,outputSchema:{type:"object",required:["authenticated"],properties:{authenticated:{type:"boolean"},email:{type:"string"},name:{type:"string"},subject:{type:"string"},clientId:{type:"string"},scope:{type:"string"},issuedAt:{type:"string"},expiresAt:{type:"string"}}}}),e.feedbackHidden||i.push({name:A,title:"Submit feedback",description:"Report a documentation page that is wrong or incomplete",schema:w,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},outputSchema:{type:"object",required:["status","page","message"],properties:{status:{type:"string"},page:{type:"string"},message:{type:"string"}}}}),e.hasGraphqlApis&&i.push(...D()),e.elicitationEnabled&&e.hasCallableApis&&i.push({name:b,title:"Create anonymous session",description:"Create an anonymous session handle for storing upstream API credentials. Pass the returned sessionHandle to execute when an API needs credentials and the caller is not signed in. Treat it as a secret and reuse it across calls.",schema:G,annotations:t,outputSchema:{type:"object",required:["sessionHandle"],properties:{sessionHandle:{type:"string"}}}}),i}const E={type:"object",required:[],additionalProperties:!1,properties:{filter:{type:"string",description:"GraphQL schema name (or part of it)",minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},N={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},kind:{type:"string",description:'Optional: return only a single category of schema members. With scope "fields", restricts to the fields of that parent category ("objects", "interfaces", or "inputs" only).',enum:[...c,null],nullable:!0},scope:{type:"string",description:'Optional: what each list item is. "members" (default) lists top-level types and operations. "fields" flattens every field of every object/interface/input type into "ParentType.fieldName" entries with their descriptions \u2014 combine with `filter` to search nested fields anywhere in the schema.',enum:[...P,null],nullable:!0},filter:{type:"string",description:'Optional: only members whose name or description contains this substring, case-insensitive (e.g. "custom tags")',minLength:1,nullable:!0},referencesType:{type:"string",description:'Optional: only members that reference this type directly or transitively (via return, field, argument, union-member or input-field types). Finds cross-cutting members that never name it \u2014 e.g. referencesType "Book" surfaces a search query returning a union that includes Book.',minLength:1,nullable:!0},page:{type:"number",description:"Page number",minimum:1,default:1,nullable:!0},limit:{type:"number",description:"Number of results per page. Default is 300",minimum:1,default:300,nullable:!0}}},_={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1},type:{type:"string",description:"Name of the type, operation, or directive",minLength:1,nullable:!0},typeName:{type:"string",description:"Alias of `type`",nullable:!0},includeReferencedTypes:{type:"boolean",description:"Also include the SDL of every type referenced transitively. Gives the whole subgraph at once, but can be large for highly-connected types.",default:!1,nullable:!0}}},k={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"GraphQL schema name",minLength:1}}};function D(){return[{name:"list-graphql-apis",title:"List GraphQL APIs",description:"Lists available GraphQL schemas with their context and purpose",schema:E,annotations:t,outputSchema:{type:"object",required:["items","limit","total","page","totalPages"],properties:{items:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string"},description:n}}},...a}}},{name:"get-graphql-type-list",title:"Get GraphQL type list",description:'List all operations and types in a GraphQL schema as a flat, paginated list. Each item is tagged with its kind (query, object, enum, \u2026) and carries a one-line description; operations also include their return type and argument signature \u2014 use it to decide which members to fetch in detail. Narrow the result with `kind` (one category), `filter` (case-insensitive substring of the member name or description, e.g. "book"), or `referencesType` (only members that use a given type, directly or transitively) to explore a domain cheaply instead of pulling the full schema. To search nested fields \u2014 not just type names \u2014 set scope "fields": it flattens every field of every object/interface/input type into "ParentType.fieldName" entries with their descriptions, so `filter` finds things like an input field whose docstring mentions your keyword.',schema:N,annotations:t,outputSchema:{type:"object",required:["name","items","limit","total","page","totalPages"],properties:{name:{type:"string"},items:{type:"array",items:{type:"object",required:["kind","name"],properties:{kind:{type:"string",enum:c},name:{type:"string"},description:n,type:{type:"string"},args:{type:"string"},directives:{type:"string"}}}},...a}}},{name:"get-graphql-type",title:"Get GraphQL type",description:'Get the SDL for a single GraphQL type, operation (query/mutation/subscription field), or directive. Without includeReferencedTypes, the SDL is followed by a one-level manifest of every directly referenced type\'s field names (e.g. "input ActionOperationInput { addTags, removeTags }"), so you can see what nested types contain before fetching them. Set includeReferencedTypes to instead pull in the full SDL of every type it references transitively \u2014 the whole structural subgraph in one call, ideal for complete exploration of an entity (e.g. Book and all the types it touches). That traversal only follows what the target depends on; to go the other direction and find the members that use a type, call get-graphql-type-list with `referencesType`.',schema:_,annotations:t,outputSchema:{type:"string"}},{name:"get-graphql-schema",title:"Get GraphQL schema",description:"Get the complete GraphQL schema as SDL \u2014 the whole type graph in one call. Returns everything, so it can be very large and token-expensive for big schemas; prefer get-graphql-type-list (filter/paginate) plus targeted get-graphql-type calls, and reach for this only for small schemas or when you truly need the full SDL.",schema:k,annotations:t,outputSchema:{type:"string"}}]}function m(e,i){const d=e&&e.length>0,y=i&&i.length>0;return{name:"search",title:"Search documentation",description:"Search across the documentation to fetch relevant content for a given query",schema:{type:"object",required:["query"],additionalProperties:!1,properties:{query:{type:"string",description:"Search query. Should be a single word or that phrase that is presented in a documentation.",minLength:1},...d?{product:{type:"string",description:"Optional product name to filter search results by specific product.",enum:[...e,null],nullable:!0}}:{},...y?{locale:{type:"string",description:"Optional locale code to filter search results by documentation language (e.g. 'en', 'ja'). Use the locale matching the language of the user's request. Defaults to the project's default locale.",enum:[...i,null],nullable:!0}}:{}}},annotations:t,outputSchema:{type:"string"}}}const M=new Set([...j({requiresLogin:!0,hasGraphqlApis:!0,elicitationEnabled:!0,hasCallableApis:!0}).map(e=>e.name),m().name]);export{M as ALL_DEFAULT_TOOL_NAMES,j as getDefaultToolSchemas};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/redoc-revel",
|
|
3
|
-
"version": "0.139.0-next.
|
|
3
|
+
"version": "0.139.0-next.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@opentelemetry/sdk-trace-web": "2.8.0",
|
|
34
34
|
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
35
35
|
"@redocly/ajv": "8.18.0",
|
|
36
|
-
"@redocly/api-docs": "0.4.0-next.
|
|
36
|
+
"@redocly/api-docs": "0.4.0-next.3",
|
|
37
37
|
"@redocly/config": "0.65.0",
|
|
38
|
-
"@redocly/openapi-core": "2.
|
|
38
|
+
"@redocly/openapi-core": "2.63.0",
|
|
39
39
|
"@redocly/portal-legacy-ui": "0.19.0",
|
|
40
|
-
"@redocly/portal-plugin-mock-server": "0.
|
|
40
|
+
"@redocly/portal-plugin-mock-server": "0.24.0-next.0",
|
|
41
41
|
"@redocly/realm-asyncapi-sdk": "0.16.0",
|
|
42
42
|
"@redocly/theme": "0.71.0-next.0",
|
|
43
43
|
"@shikijs/transformers": "3.21.0",
|