@redocly/realm 0.130.0-custom.8 → 0.130.0-custom.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{writeFileSync as C}from"node:fs";import $ from"node:path";import{REDOCLY_TEAMS_RBAC as v}from"@redocly/config";import{combineUrls as I}from"@redocly/theme/core/utils";import{PUBLIC_API_DEFINITIONS_FOLDER as w}from"../../constants/common.js";import{GRAPHQL_TEMPLATE_ID as H,GRAPHQL_SPEC_SLUG as N,PUBLIC_RBAC_SCOPE_ITEM as O}from"../../../constants/common.js";import{removeTrailingSlash as _}from"../../../utils/url/remove-trailing-slash.js";import{getTemplatePath as Q}from"./get-template-path.js";import{searchResolver as F}from"./search/search-resolver.js";import{graphqlDocLoader as M}from"./graphql-doc-loader.js";import{getAiDocumentsStore as A}from"./search/ai/get-ai-search-document.js";import{fromCurrentDir as U}from"../../utils/paths.js";import{ensureDir as k}from"../../utils/fs.js";import{telemetryTraceStep as x}from"../../../cli/telemetry/helpers/trace-step.js";const B="graphql-docs-",L="graphql-spec-download";async function nt(){return{id:"graphql",requiredEntitlements:["graphql"],loaders:{"graphql-doc":M},processContent:async(t,{fs:l,cache:i,isPathIgnored:u,withPathPrefix:p})=>{await x("build.plugin.graphql_docs",async()=>{t.createRequestHandler(L,U(import.meta.url,"./spec-download.api.js")),t.addApiRoute({slug:N+"/*",requestHandlerId:L,httpMethod:"all",[v]:O,getStaticData:async()=>({props:{}})});const m=t.createTemplate(H,Q("./template/GraphQLDocs.js"));for(const{relativePath:s}of l.scan(/(\.gql|\.graphql)$/)){if(await u(s))continue;const D=await i.load(s,"graphql-doc");if(!D.data)continue;j(D.data.content,t.outdir,s);const{menu:q,content:T,settings:n,metadata:y,store:d}=D.data,R=`${B}${s}`;await t.createSharedData(R,T);const c=[{key:"graphQlSettings",id:R}],b=q.getGroups(),G=q.getSidebarItems(),g={type:"graphql",title:n.metadata?.title||b[0].name,...y},e=[{slugSuffix:"",fsPath:s,templateId:m,getStaticData:h(void 0,n,p),sharedData:c,getAiDocumentsStore:A({label:n.info?.title??"GraphQL Overview",groupName:"overview",metadata:g,actions:t,store:d,includeInLLMsTxt:!0})}];for(const o of b){const S=`${o.id}`;e.push({slugSuffix:S,fsPath:s,templateId:m,getStaticData:h(o,n,p),sharedData:c});for(const a of o.typeGroups){const r=`${a.id}`;e.push({slugSuffix:r,fsPath:s,templateId:m,getStaticData:h(a,n,p),sharedData:c,getAiDocumentsStore:A({label:a.name,groupName:a.name,metadata:g,actions:t,store:d,isTypeGroup:!0,items:new Set(a.items)})});for(const E of a.items){const P=`${a.id}/${E}`;e.push({slugSuffix:P,fsPath:s,templateId:m,getStaticData:h(a,n,p),sharedData:c,getAiDocumentsStore:A({label:E,groupName:a.name,metadata:g,actions:t,store:d})})}}}if(!e.length)return;const f=e[0];e[0]=e[e.length-1],e[e.length-1]=f,f.metadata=g,f.getSidebar=o=>{function S(a){return a.map(r=>({...r,slug:r.slug&&_(I(o.baseSlug,r.slug)),routeSlug:r.routeSlug&&_(I(o.baseSlug,r.routeSlug)),link:r.link&&_(I(o.baseSlug,r.link)),items:r.items&&S(r.items)}))}return S(G)},f.getSearchDocuments=F(t,d);for(const o of e)t.addRoute(o)}})}}}function h(t,l,i){return async function(u){return{props:{seo:{title:t?.name},settings:{...l,location:{section:t?.id},sidebar:{hide:!0},baseUrlPath:i(u.baseSlug)},disableAutoScroll:!0}}}}function j(t,l,i){const u=w.slice(1);C(k($.resolve(l,`${u}/${i}`)),t,"utf8")}export{nt as graphqlDocsPlugin,j as storeGqlSchema};
1
+ import{writeFileSync as v}from"node:fs";import $ from"node:path";import{REDOCLY_TEAMS_RBAC as w}from"@redocly/config";import{combineUrls as _}from"@redocly/theme/core/utils";import{PUBLIC_API_DEFINITIONS_FOLDER as F}from"../../constants/common.js";import{GRAPHQL_TEMPLATE_ID as N,GRAPHQL_SPEC_SLUG as H,PUBLIC_RBAC_SCOPE_ITEM as M}from"../../../constants/common.js";import{removeTrailingSlash as I}from"../../../utils/url/remove-trailing-slash.js";import{getTemplatePath as Q}from"./get-template-path.js";import{searchResolver as U}from"./search/search-resolver.js";import{graphqlDocLoader as k}from"./graphql-doc-loader.js";import{getAiDocumentsStore as E}from"./search/ai/get-ai-search-document.js";import{fromCurrentDir as x}from"../../utils/paths.js";import{ensureDir as B}from"../../utils/fs.js";import{telemetryTraceStep as j}from"../../../cli/telemetry/helpers/trace-step.js";import{OPENAPI_CUSTOM_FIELDS_SERVER_PROPS_GETTER_ID as K}from"../../constants/plugins/openapi-docs";const V="graphql-docs-",L="graphql-spec-download";async function pt(){return{id:"graphql",requiredEntitlements:["graphql"],loaders:{"graphql-doc":k},processContent:async(t,{fs:l,cache:i,isPathIgnored:u,withPathPrefix:m,getConfig:T})=>{await j("build.plugin.graphql_docs",async()=>{t.createRequestHandler(L,x(import.meta.url,"./spec-download.api.js"));const b=!!(await T()).rules?.["custom-fields-schema"];t.addApiRoute({slug:H+"/*",requestHandlerId:L,httpMethod:"all",[w]:M,getStaticData:async()=>({props:{}})});const p=t.createTemplate(N,Q("./template/GraphQLDocs.js"));for(const{relativePath:s}of l.scan(/(\.gql|\.graphql)$/)){if(await u(s))continue;const D=await i.load(s,"graphql-doc");if(!D.data)continue;W(D.data.content,t.outdir,s);const{menu:R,content:G,settings:n,metadata:C,store:c}=D.data,A=`${V}${s}`;await t.createSharedData(A,G);const d=[{key:"graphQlSettings",id:A}],q=R.getGroups(),y=R.getSidebarItems(),g={type:"graphql",title:n.metadata?.title||q[0].name,...C},e=[{slugSuffix:"",fsPath:s,templateId:p,getStaticData:h(void 0,n,m),sharedData:d,getAiDocumentsStore:E({label:n.info?.title??"GraphQL Overview",groupName:"overview",metadata:g,actions:t,store:c,includeInLLMsTxt:!0}),serverPropsGetterIds:b?[K]:[]}];for(const o of q){const S=`${o.id}`;e.push({slugSuffix:S,fsPath:s,templateId:p,getStaticData:h(o,n,m),sharedData:d});for(const a of o.typeGroups){const r=`${a.id}`;e.push({slugSuffix:r,fsPath:s,templateId:p,getStaticData:h(a,n,m),sharedData:d,getAiDocumentsStore:E({label:a.name,groupName:a.name,metadata:g,actions:t,store:c,isTypeGroup:!0,items:new Set(a.items)})});for(const P of a.items){const O=`${a.id}/${P}`;e.push({slugSuffix:O,fsPath:s,templateId:p,getStaticData:h(a,n,m),sharedData:d,getAiDocumentsStore:E({label:P,groupName:a.name,metadata:g,actions:t,store:c})})}}}if(!e.length)return;const f=e[0];e[0]=e[e.length-1],e[e.length-1]=f,f.metadata=g,f.getSidebar=o=>{function S(a){return a.map(r=>({...r,slug:r.slug&&I(_(o.baseSlug,r.slug)),routeSlug:r.routeSlug&&I(_(o.baseSlug,r.routeSlug)),link:r.link&&I(_(o.baseSlug,r.link)),items:r.items&&S(r.items)}))}return S(y)},f.getSearchDocuments=U(t,c);for(const o of e)t.addRoute(o)}})}}}function h(t,l,i){return async function(u){return{props:{seo:{title:t?.name},settings:{...l,location:{section:t?.id},sidebar:{hide:!0},baseUrlPath:i(u.baseSlug)},disableAutoScroll:!0}}}}function W(t,l,i){const u=F.slice(1);v(B($.resolve(l,`${u}/${i}`)),t,"utf8")}export{pt as graphqlDocsPlugin,W as storeGqlSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/realm",
3
- "version": "0.130.0-custom.8",
3
+ "version": "0.130.0-custom.9",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -92,12 +92,12 @@
92
92
  "yaml-ast-parser": "0.0.43",
93
93
  "zod": "^3.25.76",
94
94
  "@redocly/asyncapi-docs": "1.7.0-custom.1",
95
- "@redocly/config": "0.43.0-custom.1",
96
95
  "@redocly/graphql-docs": "1.7.0-custom.1",
96
+ "@redocly/config": "0.43.0-custom.1",
97
97
  "@redocly/openapi-docs": "3.18.0-custom.1",
98
+ "@redocly/realm-asyncapi-sdk": "0.9.0-next.1",
98
99
  "@redocly/theme": "0.62.0-custom.2",
99
100
  "@redocly/portal-plugin-mock-server": "0.16.0-next.4",
100
- "@redocly/realm-asyncapi-sdk": "0.9.0-next.1",
101
101
  "@redocly/portal-legacy-ui": "0.14.0-next.0"
102
102
  },
103
103
  "peerDependencies": {