@redocly/redoc-reef 0.135.0-next.6 → 0.135.0-next.7
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 +28 -0
- package/dist/cli/develop.js +1 -1
- package/dist/client/templates/openapi-docs/helpers.js +1 -1
- package/dist/constants/l10n/langs/ar.js +1 -1
- package/dist/constants/l10n/langs/de.js +1 -1
- package/dist/constants/l10n/langs/en.js +1 -1
- package/dist/constants/l10n/langs/es.js +1 -1
- package/dist/constants/l10n/langs/fr.js +1 -1
- package/dist/constants/l10n/langs/hi.js +1 -1
- package/dist/constants/l10n/langs/it.js +1 -1
- package/dist/constants/l10n/langs/ja.js +1 -1
- package/dist/constants/l10n/langs/ko.js +1 -1
- package/dist/constants/l10n/langs/pl.js +1 -1
- package/dist/constants/l10n/langs/pt-BR.js +1 -1
- package/dist/constants/l10n/langs/pt.js +1 -1
- package/dist/constants/l10n/langs/ru.js +1 -1
- package/dist/constants/l10n/langs/uk.js +1 -1
- package/dist/constants/l10n/langs/zh.js +1 -1
- package/dist/server/api-routes/execute-api-route.js +1 -1
- package/dist/server/api-routes/import-api-routes-handlers.js +1 -1
- package/dist/server/constants/common.d.ts +0 -2
- package/dist/server/constants/common.js +1 -1
- package/dist/server/constants/plugins/openapi-docs.d.ts +0 -1
- package/dist/server/constants/plugins/openapi-docs.js +1 -1
- package/dist/server/esbuild/plugins/api-request-handlers-resolver.js +1 -1
- package/dist/server/esbuild/plugins/on-rebuild.d.ts +4 -4
- package/dist/server/plugins/api-functions/index.js +1 -1
- package/dist/server/plugins/catalog-classic/index.d.ts +0 -1
- package/dist/server/plugins/catalog-classic/index.js +1 -1
- package/dist/server/plugins/config-parser/loaders/redocly-config-loader.js +1 -1
- package/dist/server/plugins/config-parser/loaders/utils/read-and-validate-config.js +1 -1
- package/dist/server/plugins/lifecycle.js +2 -2
- package/dist/server/plugins/markdown/search/walk-sections.js +3 -1
- package/dist/server/plugins/mcp/constants.d.ts +1 -0
- package/dist/server/plugins/mcp/constants.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/codemode/build-tool-type-declarations.d.ts +4 -0
- package/dist/server/plugins/mcp/docs-mcp/codemode/build-tool-type-declarations.js +8 -0
- package/dist/server/plugins/mcp/docs-mcp/codemode/prompts.d.ts +5 -0
- package/dist/server/plugins/mcp/docs-mcp/codemode/prompts.js +4 -0
- package/dist/server/plugins/mcp/docs-mcp/tool-schemas.d.ts +3 -0
- package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/core/search.js +2 -2
- package/dist/server/plugins/mcp/docs-mcp/tools/core/types.d.ts +1 -0
- package/dist/server/plugins/mcp/docs-mcp/tools/execute.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/graphql/list-graphql-apis.js +1 -1
- package/dist/server/plugins/mcp/handlers/handle-mcp-request.js +1 -1
- package/dist/server/plugins/mcp/index.js +1 -1
- package/dist/server/plugins/mcp/servers/docs-server.js +3 -1
- package/dist/server/plugins/openapi-docs/index.js +1 -1
- package/dist/server/plugins/scorecard-classic/get-scorecard-config.d.ts +5 -0
- package/dist/server/plugins/scorecard-classic/index.js +1 -1
- package/dist/server/plugins/search/index.js +1 -1
- package/dist/server/plugins/sso/index.js +1 -1
- package/dist/server/store.d.ts +5 -1
- package/dist/server/store.js +1 -1
- package/dist/server/utils/ai-agent-detection.d.ts +6 -0
- package/dist/server/utils/ai-agent-detection.js +1 -1
- package/dist/server/web-server/routes/otel/otel.js +1 -1
- package/dist/server/web-server/routes/page-data.js +1 -1
- package/dist/server/web-server/utils.js +1 -1
- package/package.json +8 -8
- package/dist/server/plugins/catalog-classic/get-server-props.d.ts +0 -4
- package/dist/server/plugins/catalog-classic/get-server-props.js +0 -1
- package/dist/server/plugins/catalog-classic/get-template-path.d.ts +0 -2
- package/dist/server/plugins/catalog-classic/get-template-path.js +0 -1
- package/dist/server/plugins/mcp/docs-mcp/codemode/build-execute-tool-description.d.ts +0 -4
- package/dist/server/plugins/mcp/docs-mcp/codemode/build-execute-tool-description.js +0 -4
- package/dist/server/plugins/openapi-docs/get-server-props-custom-fields.d.ts +0 -11
- package/dist/server/plugins/openapi-docs/get-server-props-custom-fields.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const p=new Set(["https://chatgpt.com","https://anthropic.com","https://gemini.google.com","https://perplexity.ai"]),l=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","anthropic-ai","Google-Extended","Gemini-Deep-Research","Google-CloudVertexBot","PerplexityBot","Perplexity-User","Meta-ExternalAgent","Meta-ExternalFetcher","meta-webindexer","CrawlBot","CCBot","Bytespider","DuckAssistBot","Cursor"];function m(t,e,r){return Math.min(r,Math.max(e,t))}function u(t){if(!t?.trim())return[];const e=[],r=t.split(",").map(o=>o.trim());for(const o of r){if(!o)continue;const[n,...a]=o.split(";").map(s=>s.trim().toLowerCase());if(!n.includes("/"))continue;let i=1;for(const s of a)if(s.startsWith("q=")){const c=parseFloat(s.slice(2));i=Number.isFinite(c)?m(c,0,1):1;break}e.push({type:n,q:i})}return e}function f(t){const e=u(t),r=Math.max(0,...e.filter(n=>n.type==="text/html").map(n=>n.q)),o=Math.max(0,...e.filter(n=>n.type==="text/markdown").map(n=>n.q));return o>=r&&o>0}function x(t){return u(t??"").some(r=>r.type==="text/html"&&r.q>0)}function h(t){if(!t||!t.trim().length)return!1;const e=t.trim().toLowerCase().replace(/\/$/,"");return p.has(e)}function d(t){if(!t)return!1;const e=t.toLowerCase();return l.some(r=>e.includes(r.toLowerCase()))}function g(t){const{accept:e,signatureAgent:r,signature:o,signatureInput:n,userAgent:a}=t;return!!(f(e??"")||h(r)&&(o!==void 0||n!==void 0)||d(a))}export{x as acceptsHtml,g as isAiAgentRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AsyncApiRealmAPI as
|
|
1
|
+
import{AsyncApiRealmAPI as y}from"@redocly/realm-asyncapi-sdk";import{envConfig as o}from"../../../config/env-config.js";import{getClientIp as R}from"../../utils/get-client-ip.js";import{getAttributesStringValue as I,mergeAttributes as h,toAttribute as O}from"./otlp.js";const C=o.OTEL_TRACES_URL||"https://otel.cloud.redocly.com/v1/traces",A="cloudevents.event_session_id";class w extends y.OtelClient{initTracer(){}}let d=null;function E(){return d||(d=new w,d.init({collectorTraceUrl:void 0,serviceName:"realm-ui",serviceVersion:"1.0",isProd:o.isProductionEnv,version:"1.0",tracerName:"attribute-processor"})),d}async function $(e){const t=await e.req.json();return t.resourceSpans?.length&&(N(t,j(e)),await fetch(C,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})),e.newResponse(null,200)}function N(e,t){for(const s of e.resourceSpans){const r=s.resource.attributes.find(u=>u.key==="session_id");if(!r)continue;const i=I(r);if(!i)continue;const l=L(t.userId,i),_=new Date,v={organizationId:o.ORGANIZATION_ID||"",organizationSlug:o.ORGANIZATION_SLUG||"",projectId:o.PROJECT_ID||"",projectSlug:o.PROJECT_SLUG||"",env:o.REDOCLY_ENV||"",source:"urn:redocly:realm:ui",actor:{id:l.id,object:l.object,uri:l.uri},clientIp:t.clientIp,userAgent:t.userAgent},c=(u,n)=>{const a=u.attributes.find(f=>f.key===n);return a?I(a):""};for(const u of s.scopeSpans)for(const n of u.spans){if(!n.name.startsWith("event.")||n.name==="event.undefined")continue;const a=c(n,"cloudevents.event_spec_version"),f=c(n,"cloudevents.event_object"),g=c(n,"cloudevents.event_data_content_type"),b=c(n,"cloudevents.event_origin"),p=c(n,"cloudevents.event_time"),m=p?new Date(p):_,S={...v,id:c(n,"cloudevents.event_id"),specversion:a,type:n.name.slice(6),object:f,datacontenttype:g,time:m,origin:b},T=E().processAttributes(S,m);h(n,T,{overwrite:!0}),P(n,t.sessionId)}}}function P(e,t){const s=e.attributes.findIndex(i=>i.key===A),r=O(A,t);r?s===-1?e.attributes.push(r):e.attributes[s]=r:s!==-1&&e.attributes.splice(s,1)}function j(e){const t=e.get("auth")?.claims?.id||e.get("auth")?.claims?.sub,s=e.get("auth")?.claims?.sessionId,r=R(e.req.raw)||e.req.raw.context?.remoteAddr?.hostname,i=e.req.raw.headers.get("user-agent");return{userId:t,sessionId:s||void 0,clientIp:r??void 0,userAgent:i??void 0}}function L(e,t){if(e)return{id:e,object:"user",uri:`${o.MAIN_API_URL}/users/${e}`};const s=t.replace("ses_","ann_");return{id:s,object:"anonymous",uri:`${o.MAIN_API_URL}/anonymous/${s}`}}export{$ as otelTracesHandler,L as toActor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ServerRoutes as
|
|
1
|
+
import{ServerRoutes as U}from"../../../constants/api.js";import{DEV_LOGIN_SLUG as $}from"../../../constants/common.js";import{CACHE_CONTROL_NO_STORE_HEADER_VALUE as r,DEFAULT_TITLE as F}from"../../constants/common.js";import{findInIterable as N}from"../../../utils/collection/find-in-iterable.js";import{removeTrailingSlash as q}from"../../../utils/url/remove-trailing-slash.js";import{envConfig as T}from"../../config/env-config.js";import{canAccessResource as B,filterDataByAccessDeep as j,isResourcePubliclyAccessible as H}from"../../utils/rbac.js";import{getServerProps as M}from"../../ssr/index.js";import{readSharedData as G}from"../../utils/index.js";import{getRedirectLoginUrl as V}from"../utils/get-redirect-login-url.js";import{processRedirects as W}from"./helpers/process-redirects.js";import{removeErrorDetails as k}from"../utils/remove-error-details.js";import{telemetry as K}from"../../telemetry/index.js";import{MCP_NOT_ALLOWED_TEMPLATE_ID as A}from"../../plugins/mcp/constants.js";function ie(e,n){return async(t,g)=>{const m=t.get("logger"),{req:p}=t,{pathname:d}=new URL(p.url),{seo:f,ssoDirect:h}=e.getConfig(),i=f?.title||F;if(e?.compilationErrors?.length&&T.isDevelopMode)return t.json({templateId:"compilation-error",props:{compilationErrors:e?.compilationErrors},sharedDataIds:{}},500,{"Cache-Control":r});const u=d.match(/page-data(.*)data.json$/);if(!u)return g();const c=decodeURI(u[1]),s=c==="/index/"?"/":q(c),o=e.getRouteBySlug(s,{followRedirect:!1})||N(e.routesBySlug.values(),a=>a.hasClientRoutes&&c.startsWith(a.slug+"/"));if(c===U.OIDC_CALLBACK+"/")return t.json({templateId:"403OIDC",sharedDataIds:{},props:{seo:{title:`${i} - Forbidden`}}},200,{"Cache-Control":r});const{isAuthenticated:C,teams:D,claims:{name:S,picture:_,email:I}}=t.get("auth"),R={isAuthenticated:C,email:I,teams:D},l={isAuthenticated:C,name:S,picture:_,email:I,teams:D};if(s==="/mcp"&&e.templates.has(A))return t.json({templateId:A,sharedDataIds:{},props:{},userData:l},405,{"Cache-Control":r});const L=e.getRedirect(s);if(L){const a=W({redirect:L}).location;return K.sendRedirectMessage([{object:"redirect",from:s,templateId:"404"}]),t.json({templateId:"404",redirectTo:a,sharedDataIds:{},props:{}},301,{"Cache-Control":r})}if(!o){const a=e.getRouteBySlug(s,{followRedirect:!0});return m.error(`Page not found: ${d}`),t.json({templateId:"404",redirectTo:a?.slug,sharedDataIds:{},props:{seo:{title:`${i} - Not Found`}},userData:l},404,{"Cache-Control":r})}if(m.verbose(`Page viewed: ${o.slug}`),!B(o,R,e.config.access?.rbac,e.config.access?.requiresLogin)&&o.slug!==$){if(C)return t.json({templateId:"403",sharedDataIds:{},props:{seo:{title:`${i} - Forbidden`}},userData:l},403,{"Cache-Control":r});const a=Object.keys(h||{}).length>0;return t.json({templateId:"404",sharedDataIds:{},props:{seo:{title:`${i} - Not Found`}},userData:l,...a?{redirectTo:V(e,o.slug)}:{}},a?401:404,{"Cache-Control":r})}const b=j(o.versions,R,e.config.access?.rbac,e.config.access?.requiresLogin),v=e.routesSharedData.get(o.slug)||{},P=await n(o),O=await M(o,t,P,e),{sharedDataIds:y,...E}=O,w={templateId:o.templateId,versions:b,sharedDataIds:{...v,...y||{}},props:T.isProductionEnv?k(E):E,slug:o.slug,userData:l,isPublic:H(o,e.config)};return t.json(w,200,{"Cache-Control":r})}}function ce(e){return async(n,t)=>{const g=n.get("logger"),{req:m}=n,{pathname:p}=new URL(m.url),d=p.match(/\/page-data\/shared\/(.*)\.json/);if(!d)return t();const f=decodeURIComponent(d[1]),h=await G(f,e.outdir),{isAuthenticated:i,teams:u,claims:{email:c}}=n.get("auth"),s=j(h,{isAuthenticated:i,email:c,teams:u},e.config.access?.rbac,e.config.access?.requiresLogin);return s?n.json(s,200,{"Cache-Control":r}):(g.error(`Shared data not found: ${p}`),n.text("Not Found",404,{"Cache-Control":r}))}}export{ie as pageDataHandler,ce as sharedPageDataHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setCookie as
|
|
1
|
+
import{setCookie as b}from"hono/cookie";import{withPathPrefix as l}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as A}from"../../constants/common.js";import{CACHE_CONTROL_NO_STORE_HEADER_VALUE as y}from"../constants/common.js";import{getAuthProviderLoginParams as C,buildLoginUrl as O}from"./auth.js";import{renderPage as R}from"../ssr/index.js";import{telemetry as _}from"../../cli/telemetry/index.js";async function T(r,t,o,n){const{isAuthenticated:a}=r.get("auth"),i=r.req.raw.headers.get("x-forwarded-host"),e=r.req.raw.headers.get("x-forwarded-proto"),w=i?`${e==="http"||e==="https"?e:"https"}://${i}`:new URL(r.req.url).origin,g=t.getConfig().ssoDirect,p=Object.keys(g||{}),s=n||p[0],m=g?.[s];if(a)return v(r,t,{slug:o},403);const d=s&&m?await C(s,m):void 0,f=d?{...d,extraParams:{...d.extraParams,prompt:"login"}}:void 0,{loginUrl:E,cookies:h={}}=f&&O(f,w,l(o))||{},L=t.globalData.auth?.devLogin||p.length>1?z(o):E;return Object.keys(h).forEach(c=>{b(r,c,h[c].value,h[c].options)}),L?r.newResponse(null,302,{Location:L}):r.text("Unauthorized",401)}const P={};async function v(r,t,o,n,a){const i=a||String(n);let e=P[i];if(!e){const u={templateId:String(a||n),fsPath:"/",...o,baseSlug:o.slug};e=(await R(u,{},r,t,_)).html,P[i]=e}return r.html(e,n,{"Cache-Control":y})}function z(r){const t=new URLSearchParams({redirectTo:l(r)});return`${l(A)}?${t}`}async function j(r){return r.text("Forbidden",U(r))}function k(r){return r.json({message:"Forbidden"},U(r))}function U(r){const{isAuthenticated:t}=r.get("auth");return t?403:401}function G(r){const t=r?.match(/(?:^|:)(\d{1,3}(?:\.\d{1,3}){3})$/);return t?t[1]:r}export{z as getLoginUrlWithRedirect,v as handleErrorPageRender,T as handleUnauthorized,k as handleUnauthorizedApiRequest,j as handleUnauthorizedAsset,G as normalizeIpAddress};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/redoc-reef",
|
|
3
|
-
"version": "0.135.0-next.
|
|
3
|
+
"version": "0.135.0-next.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
34
34
|
"@redocly/ajv": "8.18.0",
|
|
35
35
|
"@redocly/mcp-typescript-sdk": "1.18.1",
|
|
36
|
-
"@redocly/openapi-core": "2.
|
|
36
|
+
"@redocly/openapi-core": "2.37.0",
|
|
37
37
|
"@shikijs/transformers": "3.21.0",
|
|
38
38
|
"@tanstack/react-query": "5.62.3",
|
|
39
39
|
"@tanstack/react-table": "8.21.3",
|
|
@@ -93,14 +93,14 @@
|
|
|
93
93
|
"xpath": "0.0.34",
|
|
94
94
|
"yaml-ast-parser": "0.0.43",
|
|
95
95
|
"zod": "^3.25.76",
|
|
96
|
-
"@redocly/asyncapi-docs": "1.12.0-next.
|
|
97
|
-
"@redocly/config": "0.
|
|
98
|
-
"@redocly/graphql-docs": "1.12.0-next.
|
|
99
|
-
"@redocly/openapi-docs": "3.23.0-next.
|
|
96
|
+
"@redocly/asyncapi-docs": "1.12.0-next.7",
|
|
97
|
+
"@redocly/config": "0.50.1",
|
|
98
|
+
"@redocly/graphql-docs": "1.12.0-next.7",
|
|
99
|
+
"@redocly/openapi-docs": "3.23.0-next.7",
|
|
100
100
|
"@redocly/portal-legacy-ui": "0.18.0-next.0",
|
|
101
|
+
"@redocly/portal-plugin-mock-server": "0.20.0-next.7",
|
|
101
102
|
"@redocly/realm-asyncapi-sdk": "0.13.0-next.4",
|
|
102
|
-
"@redocly/theme": "0.67.0-next.
|
|
103
|
-
"@redocly/portal-plugin-mock-server": "0.20.0-next.6"
|
|
103
|
+
"@redocly/theme": "0.67.0-next.6"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"react": "^19.2.4",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{REGISTRY_APIS_API_URL as t}from"../../constants/common.js";import{logger as o}from"../../tools/notifiers/logger.js";const a=async(p,e,r)=>{if(!r.variables?.idpAccessToken)return o.warnProd("Cannot fetch custom fields: access token not found"),e.props||{};if(!t)return o.warnProd("Cannot fetch custom fields: API URL not found in env"),e.props||{};const n={};try{const s=await fetch(t+"?limit=2000",{headers:{Cookie:`accessToken=${r.variables.idpAccessToken}`}});if(s.status!==200)return o.warnProd(`Failed to fetch custom fields. API response status: ${s.status}. Request URL: ${t}`),e.props||{};const i=await s.json();for(const c of i.items)n[c.contentPath]=c.customFields||{}}catch(s){o.warnProd("Failed to fetch custom fields: "+s.message)}return{...e.props,customFields:n}};var d=a;export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fromCurrentDir as t}from"../../utils/paths.js";function m(r){return t(import.meta.url,r)}export{m as getTemplatePath};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const c=/^[A-Za-z_$][\w$]*$/;function p(e){const n=e.split(/[^A-Za-z0-9]+/).filter(Boolean).map((o,r)=>r===0?o:o[0].toUpperCase()+o.slice(1)).join("");return c.test(n)?n:`_${n}`}function y(e){return["Execute JavaScript in a sandbox to call the documentation tools below.","","Each tool is an async function on the global `tools` object.","","Do everything one request needs in a SINGLE execution: call as many tools as you need,","pass one call's output into the next, and branch or loop on intermediate results, then","`return` the final value. Each `execute` call is a full round-trip, so one script that","gathers everything is far cheaper and faster than several sequential calls. Only make","another `execute` call when you must react to something you genuinely could not","anticipate, and never repeat discovery you have already done.","","Example \u2014 one call that lists APIs, then drills into an endpoint:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const { endpoints } = await tools.getEndpoints({ name: items[0].name });","return tools.getEndpointInfo({"," name: items[0].name,"," path: endpoints[0].path,"," method: endpoints[0].method,","});","```","","Available tools:","","Types named `OpenApi\u2026` are the standard OpenAPI Specification objects.","","```ts","declare const tools: {",e.map(n=>{const o=n.schema,r=s(o),u=n.outputSchema?s(n.outputSchema):"unknown",a=o.required?.length?"input":"input?";return` /** ${n.description} */
|
|
2
|
-
${p(n.name)}(${a}: ${r}): Promise<${u}>;`}).join(`
|
|
3
|
-
`),"};","```"].join(`
|
|
4
|
-
`)}function s(e){if(!e||typeof e!="object")return"unknown";const t=e.nullable?" | null":"";if(typeof e.codemodeType=="string")return e.codemodeType+t;if(Array.isArray(e.enum))return e.enum.map(d).join(" | ")+t;switch(e.type){case"string":return"string"+t;case"number":case"integer":return"number"+t;case"boolean":return"boolean"+t;case"array":return`Array<${s(e.items)}>`+t;case"object":return f(e)+t;default:return"unknown"}}function d(e){return typeof e=="string"?`'${e}'`:String(e)}function f(e){const t=e.properties??{},n=Object.keys(t),o=e.additionalProperties,r=o?o===!0?"unknown":s(o):void 0;if(n.length===0)return o===!1?"{}":`Record<string, ${r??"unknown"}>`;const u=new Set(e.required??[]),a=n.map(i=>{const l=u.has(i)?"":"?";return`${c.test(i)?i:JSON.stringify(i)}${l}: ${s(t[i])}`});return r&&a.push(`[key: string]: ${r}`),`{ ${a.join("; ")} }`}export{y as buildExecuteToolDescription,p as sanitizeToolName};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { PageRouteDetails } from '../../types';
|
|
2
|
-
import type { MdOptions } from '@redocly/config';
|
|
3
|
-
/** Load API catalog entry custom fields from the API registry */
|
|
4
|
-
export default function getServerProps(props: PageRouteDetails, _data: any, { variables }: MdOptions & {
|
|
5
|
-
variables: {
|
|
6
|
-
idpAccessToken?: string;
|
|
7
|
-
};
|
|
8
|
-
}): Promise<{
|
|
9
|
-
customFields: Record<string, unknown>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=get-server-props-custom-fields.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import i from"path";import{REGISTRY_APIS_PATHS_API_URL as a}from"../../constants/common.js";import{logger as n}from"../../tools/notifiers/logger.js";async function p(r,d,{variables:o}){const c=i.posix.dirname(r.fsPath);let t={};if(o.idpAccessToken&&a)try{const s=a+"/"+encodeURIComponent(c),e=await fetch(s,{headers:{Cookie:`accessToken=${o.idpAccessToken}`}});e.status!==200?n.warnProd(`Failed to fetch custom fields. API response status: ${e.status}. Request URL: ${s}`):t=(await e.json()).customFields||{}}catch(s){n.warnProd("Failed to fetch custom fields: "+s.message)}return{customFields:t}}export{p as default};
|