@redocly/reef 0.131.0-next.12 → 0.131.0-next.14
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/client/templates/asyncapi-docs/template.js +1 -3
- package/dist/client/templates/openapi-docs/template.js +2 -6
- 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/node-bundle-entry.js +1 -1
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts +7 -0
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.d.ts +22 -0
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-read-repository.js +29 -15
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.d.ts +6 -0
- package/dist/server/plugins/catalog-entities/database/repositories/local/catalog-entities-local-repository.js +1 -1
- package/dist/server/plugins/entitlements/index.js +1 -1
- package/dist/server/plugins/entitlements/utils/get-billed-catalog-build-pages-count.d.ts +6 -0
- package/dist/server/plugins/entitlements/utils/get-billed-catalog-build-pages-count.js +1 -0
- package/dist/server/plugins/markdown/search/nodes/heading-node.js +1 -1
- package/dist/server/plugins/pages/validators/validate-react-pages.js +1 -1
- package/dist/server/web-server/routes/catalog/catalog.js +1 -1
- package/dist/server/web-server/routes/catalog/helpers/upsert-pages-stats.d.ts +12 -0
- package/dist/server/web-server/routes/catalog/helpers/upsert-pages-stats.js +1 -0
- package/dist/server/web-server/routes/cors-proxy.js +2 -2
- package/package.json +10 -10
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
import type { CatalogEntitiesService } from '../../../../plugins/catalog-entities/database/catalog-entities-service';
|
|
3
|
+
import type { EntityReadModelSchema } from '../../../../plugins/catalog-entities/schemas/read-model-schemas';
|
|
4
|
+
type UpsertPagesStatsParams = {
|
|
5
|
+
ctx: Context;
|
|
6
|
+
catalogEntitiesService: CatalogEntitiesService;
|
|
7
|
+
addedEntities?: EntityReadModelSchema[];
|
|
8
|
+
removedEntities?: EntityReadModelSchema[];
|
|
9
|
+
};
|
|
10
|
+
export declare function upsertPagesStats({ ctx, catalogEntitiesService, addedEntities, removedEntities, }: UpsertPagesStatsParams): Promise<void>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=upsert-pages-stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{envConfig as t}from"../../../../config/env-config.js";async function f({ctx:o,catalogEntitiesService:r,addedEntities:s,removedEntities:n}){if(t.REDOCLY_ENV!=="production"){o.get("logger").info("Skipping pages stats upsert in non-production environment");return}if(!t.BH_API_URL||!t.ORGANIZATION_ID||!t.PROJECT_ID)throw new Error("Pages stats service not configured");const a=o.req.header("apiKey");if(!a)throw new Error("API key is required to upsert pages stats");const{total:i}=await r.getDuplicatedEntitiesCount(s,n),{total:p}=await r.getEntitiesCount("remote",s,n?.length),g={remoteEntityPages:p,duplicatedEntityPages:i,isReported:!1},c=new URL(`/api/orgs/${t.ORGANIZATION_ID}/projects/${t.PROJECT_ID}/project-pages-stats`,t.BH_API_URL).toString();try{const e=await fetch(c,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(g)});if(!e.ok)throw new Error(e.statusText)}catch(e){throw new Error(`Failed to upsert project pages stats: ${e?.message}`)}}export{f as upsertPagesStats};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{withPathPrefix as
|
|
2
|
-
Usage: ${o}/https://api.example.com/path`);const
|
|
1
|
+
import{withPathPrefix as _}from"@redocly/theme/core/utils";import{ServerRoutes as q}from"../../../constants/common.js";import{getRequestOrigin as C}from"../utils/get-request-origin.js";const P=new Set(["connection","keep-alive","proxy-authenticate","proxy-connection","proxy-authorization","te","trailer","transfer-encoding","upgrade","host"]),$=new Set(["cookie","cookie2","accept-encoding"]),T=new Set(["set-cookie","set-cookie2","content-encoding","content-length"]),g="x-redocly-proxy-streaming",H="x-http-method-override",w="x-redocly-cookie";function z(o=_(q.CORS_PROXY)){return async e=>{const n=new URL(e.req.url).pathname;if(n===o||n===`${o}/`)return e.text(`Realm CORS proxy endpoint.
|
|
2
|
+
Usage: ${o}/https://api.example.com/path`);const r=I(e.req.url,o);if(!r)return e.text("Invalid proxied URL",400);const i=C(e),c=r.origin===i,h=r.pathname===o||r.pathname.startsWith(`${o}/`);if(c&&!h)return new Response("Please use a direct request",{status:308,headers:{Location:r.toString(),Vary:"origin","Cache-Control":"private"}});const s=new Headers,f=S(e.req.raw.headers);for(const[t,E]of e.req.raw.headers)f.has(t.toLowerCase())||$.has(t.toLowerCase())||s.append(t,E);const d=s.get(w);if(d){const t=e.req.raw.headers.get("cookie")||"";s.set("cookie",t?`${t}; ${d}`:d),s.delete(w)}const u=e.req.raw.headers.get("origin")||"";L(u)&&s.delete("origin");let p=e.req.method;const R=s.get(H);R&&(p=R.toUpperCase(),s.delete(H));const m={method:p,headers:s,redirect:"follow"};p!=="GET"&&p!=="HEAD"&&e.req.raw.body&&(m.body=e.req.raw.body,m.duplex="half");let a;try{a=await fetch(r,m)}catch(t){const E=t instanceof Error?t.message:"unknown error",O=t instanceof Error&&t.cause instanceof Error?`: ${t.cause.message}`:"";return e.text(`Failed to proxy request: ${E}${O}`,502)}const l=new Headers(a.headers),y=S(a.headers);for(const t of y)l.delete(t);for(const t of T)l.delete(t);return l.set(g,"1"),new Response(a.body,{status:a.status,statusText:a.statusText,headers:l})}}function k(o){try{return decodeURIComponent(o)}catch{return o}}function D(o){return o.replace(/^(https?):\/(?!\/)/i,"$1://")}function A(o,e){return e?o.includes("?")?e==="?"?o:`${o.endsWith("?")||o.endsWith("&")?o:`${o}&`}${e.slice(1)}`:`${o}${e}`:o}function S(o){const e=new Set(P),n=o.get("connection");if(!n)return e;for(const r of n.split(",")){const i=r.trim().toLowerCase();i&&e.add(i)}return e}function L(o){const e=o.toLowerCase();return e.includes(".redocly.app")||e.includes("localhost")}function I(o,e){const n=new URL(o),r=n.pathname===e,i=n.pathname.startsWith(`${e}/`);if(!r&&!i)return null;const c=n.pathname.slice(e.length).replace(/^\/+/,"");if(!c)return null;const h=[c,k(c)];for(const s of h){const f=D(s),d=A(f,n.search);try{const u=new URL(d);if(u.protocol==="http:"||u.protocol==="https:")return u}catch{continue}}return null}const U=g;export{U as CORS_PROXY_STREAM_HEADER,z as corsProxyHandler,I as resolveCorsProxyTarget};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/reef",
|
|
3
|
-
"version": "0.131.0-next.
|
|
3
|
+
"version": "0.131.0-next.14",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@opentelemetry/sdk-trace-web": "2.0.1",
|
|
30
30
|
"@opentelemetry/semantic-conventions": "1.34.0",
|
|
31
31
|
"@redocly/ajv": "8.18.0",
|
|
32
|
-
"@redocly/openapi-core": "2.20.
|
|
32
|
+
"@redocly/openapi-core": "2.20.5",
|
|
33
33
|
"@shikijs/transformers": "3.21.0",
|
|
34
34
|
"@tanstack/react-query": "5.62.3",
|
|
35
35
|
"@tanstack/react-table": "8.21.3",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"nanoid": "5.0.9",
|
|
65
65
|
"node-fetch": "3.3.1",
|
|
66
66
|
"nprogress": "0.2.0",
|
|
67
|
-
"openapi-sampler": "1.7.
|
|
67
|
+
"openapi-sampler": "^1.7.2",
|
|
68
68
|
"os-browserify": "0.3.0",
|
|
69
69
|
"path-browserify": "1.0.1",
|
|
70
70
|
"picomatch": "2.3.1",
|
|
@@ -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.8.0-next.
|
|
95
|
-
"@redocly/config": "0.44.
|
|
96
|
-
"@redocly/graphql-docs": "1.8.0-next.
|
|
97
|
-
"@redocly/openapi-docs": "3.19.0-next.
|
|
94
|
+
"@redocly/asyncapi-docs": "1.8.0-next.9",
|
|
95
|
+
"@redocly/config": "0.44.1",
|
|
96
|
+
"@redocly/graphql-docs": "1.8.0-next.7",
|
|
97
|
+
"@redocly/openapi-docs": "3.19.0-next.9",
|
|
98
98
|
"@redocly/portal-legacy-ui": "0.14.0-next.0",
|
|
99
|
-
"@redocly/portal-plugin-mock-server": "0.16.0-next.
|
|
100
|
-
"@redocly/realm-asyncapi-sdk": "0.9.0-next.
|
|
101
|
-
"@redocly/theme": "0.63.0-next.
|
|
99
|
+
"@redocly/portal-plugin-mock-server": "0.16.0-next.9",
|
|
100
|
+
"@redocly/realm-asyncapi-sdk": "0.9.0-next.5",
|
|
101
|
+
"@redocly/theme": "0.63.0-next.6"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"react": "^19.2.4",
|