@redocly/realm 0.130.0-custom.15 → 0.130.0-custom.16
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{REGISTRY_APIS_API_URL as r}from"../../constants/common.js";import{logger as e}from"../../tools/notifiers/logger.js";let c=null;async function f(){try{const s=process.env.REGISTRY_API_KEY||"";if(!s){e.warnProd("Cannot fetch custom fields: API key not found in env");return}const i=await(await fetch(r+"?limit=
|
|
1
|
+
import{REGISTRY_APIS_API_URL as r}from"../../constants/common.js";import{logger as e}from"../../tools/notifiers/logger.js";let c=null;async function f(){try{const s=process.env.REGISTRY_API_KEY||"";if(!s){e.warnProd("Cannot fetch custom fields: API key not found in env");return}const i=await(await fetch(r+"?limit=6000&fields=id,contentPath,customFields",{headers:{Authorization:`Bearer ${s}`}})).json();c={};for(const o of i.items)c[o.contentPath]=o.customFields||{};e.info("Refreshed cached API fields")}catch(s){console.log("error",s),e.warnProd("Failed to refresh cached API fields: "+s.message)}}f(),setInterval(f,1e3*60*5);async function m(s,t,i){const o=process.env.REDOCLY_LOCAL_DEV_TOKEN||i.variables.idpAccessToken;if(!o)return e.warnProd("Cannot fetch custom fields: access token not found"),t.props||{};if(!r)return e.warnProd("Cannot fetch custom fields: API URL not found in env"),t.props||{};const u=c||await l();return{...t.props,customFields:u};async function l(){try{const n=await fetch(r+"?limit=6000&fields=id,contentPath,customFields",{headers:{Cookie:`accessToken=${o}`}});if(n.status!==200)return e.warnProd(`Failed to fetch custom fields. API response status: ${n.status}. Request URL: ${r}`),t.props;const p=await n.json(),a={};for(const d of p.items)a[d.contentPath]=d.customFields||{};return a}catch(n){return e.warnProd("Failed to fetch custom fields: "+n.message),{}}}}export{m as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/realm",
|
|
3
|
-
"version": "0.130.0-custom.
|
|
3
|
+
"version": "0.130.0-custom.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -91,14 +91,14 @@
|
|
|
91
91
|
"xpath": "0.0.34",
|
|
92
92
|
"yaml-ast-parser": "0.0.43",
|
|
93
93
|
"zod": "^3.25.76",
|
|
94
|
+
"@redocly/asyncapi-docs": "1.7.0-custom.2",
|
|
94
95
|
"@redocly/config": "0.43.0-custom.1",
|
|
95
|
-
"@redocly/graphql-docs": "1.7.0-custom.2",
|
|
96
|
-
"@redocly/openapi-docs": "3.18.0-custom.1",
|
|
97
96
|
"@redocly/realm-asyncapi-sdk": "0.9.0-next.1",
|
|
98
|
-
"@redocly/
|
|
97
|
+
"@redocly/openapi-docs": "3.18.0-custom.1",
|
|
98
|
+
"@redocly/graphql-docs": "1.7.0-custom.2",
|
|
99
99
|
"@redocly/theme": "0.62.0-custom.2",
|
|
100
|
-
"@redocly/portal-
|
|
101
|
-
"@redocly/portal-
|
|
100
|
+
"@redocly/portal-legacy-ui": "0.14.0-next.0",
|
|
101
|
+
"@redocly/portal-plugin-mock-server": "0.16.0-next.4"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"react": "^19.2.4",
|