@redocly/realm 0.138.0-next.2 → 0.138.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 +31 -0
- package/dist/client/App.js +1 -1
- package/dist/client/TestProvider.d.ts +3 -1
- package/dist/client/TestProvider.js +1 -1
- package/dist/client/app/hooks/codeHighlight/useCodeHighlight.js +1 -1
- package/dist/client/app/hooks/index.d.ts +1 -0
- package/dist/client/app/hooks/index.js +1 -1
- package/dist/client/app/hooks/useConsent.d.ts +11 -0
- package/dist/client/app/hooks/useConsent.js +1 -0
- package/dist/client/app/webmcp/index.d.ts +2 -0
- package/dist/client/app/webmcp/index.js +1 -0
- package/dist/client/app/webmcp/tools/api-tools.d.ts +8 -0
- package/dist/client/app/webmcp/tools/api-tools.js +1 -0
- package/dist/client/app/webmcp/tools/shared.d.ts +13 -0
- package/dist/client/app/webmcp/tools/shared.js +1 -0
- package/dist/client/app/webmcp/tools/site-tools.d.ts +5 -0
- package/dist/client/app/webmcp/tools/site-tools.js +3 -0
- package/dist/client/app/webmcp/types.d.ts +36 -0
- package/dist/client/app/webmcp/types.js +0 -0
- package/dist/client/app/webmcp/useWebMcpTools.d.ts +9 -0
- package/dist/client/app/webmcp/useWebMcpTools.js +1 -0
- package/dist/client/providers/theme/ThemeDataProvider.js +1 -1
- package/dist/constants/common.d.ts +1 -0
- package/dist/constants/common.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/markdoc/nodes/table.d.ts +2 -0
- package/dist/markdoc/nodes/table.js +1 -1
- package/dist/server/constants/entitlements.js +1 -1
- package/dist/server/constants/plugins/consent.d.ts +3 -0
- package/dist/server/constants/plugins/consent.js +1 -0
- package/dist/server/plugins/analytics/adobe/index.js +1 -1
- package/dist/server/plugins/analytics/amplitude/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/amplitude/index.js +1 -1
- package/dist/server/plugins/analytics/fullstory/index.js +1 -1
- package/dist/server/plugins/analytics/ga/index.js +1 -1
- package/dist/server/plugins/analytics/gtm/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/gtm/index.js +1 -1
- package/dist/server/plugins/analytics/heap/browser-hooks.js +1 -1
- package/dist/server/plugins/analytics/rudderstack/index.js +1 -1
- package/dist/server/plugins/analytics/segment/index.js +1 -1
- package/dist/server/plugins/config-parser/format-custom-tags.d.ts +1 -0
- package/dist/server/plugins/config-parser/format-custom-tags.js +1 -1
- package/dist/server/plugins/config-parser/index.js +1 -1
- package/dist/server/plugins/config-parser/loaders/redocly-config-loader.js +1 -1
- package/dist/server/plugins/consent/build-consent-script.d.ts +6 -0
- package/dist/server/plugins/consent/build-consent-script.js +230 -0
- package/dist/server/plugins/consent/gate-ssr-components.d.ts +5 -0
- package/dist/server/plugins/consent/gate-ssr-components.js +1 -0
- package/dist/server/plugins/consent/index.d.ts +3 -0
- package/dist/server/plugins/consent/index.js +1 -0
- package/dist/server/plugins/consent/is-consent-enabled.d.ts +8 -0
- package/dist/server/plugins/consent/is-consent-enabled.js +1 -0
- package/dist/server/plugins/consent/zone-modes.d.ts +8 -0
- package/dist/server/plugins/consent/zone-modes.js +1 -0
- package/dist/server/plugins/lifecycle.js +2 -2
- package/dist/server/plugins/markdown/markdoc/markdoc-options.d.ts +2 -0
- package/dist/server/plugins/markdown/search/get-ai-search-documents.js +9 -9
- package/dist/server/plugins/markdown/search/nodes/tag-node.d.ts +1 -1
- package/dist/server/plugins/markdown/search/nodes/tag-node.js +1 -1
- package/dist/server/plugins/mcp/audit/audit-log.js +1 -1
- package/dist/server/utils/redact-url.d.ts +6 -0
- package/dist/server/utils/redact-url.js +1 -0
- package/dist/server/web-server/jwt/jwt.js +1 -1
- package/dist/server/web-server/jwt/types.d.ts +4 -4
- package/dist/server/web-server/jwt/types.js +1 -1
- package/dist/server/web-server/middleware/telemetry-middleware.js +1 -1
- package/dist/types/entitlements.d.ts +1 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SectionNode as r,WithCounterId as o}from"./section-node.js";const i=["title","
|
|
1
|
+
import{SectionNode as r,WithCounterId as o}from"./section-node.js";const i=["title","name","label"];class s extends o(r){constructor(t){super(t)}getUrl(t){return this.parentNode?.getUrl(t)??t}getPath(t){let e=this.parentNode?.getPath(t);return e||(e=this.content?[this.content]:[]),e}}export{i as TAG_TITLE_ATTRIBUTES,s as TagNode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash as
|
|
1
|
+
import{createHash as c}from"node:crypto";import{logger as s}from"../../../tools/notifiers/logger.js";import{redactUrl as f}from"../../../utils/redact-url.js";import{AUDIT_LOG_PREFIX as p}from"./constants.js";import{redactSecretsFromString as u}from"../gateway-mcp/fetch/redact.js";import{redactSecretShapes as a}from"./secret-patterns.js";import{AUDIT_LOG_PREFIX as L}from"./constants.js";const i=4096;function d(t){return c("sha256").update(t,"utf8").digest("hex")}function m(t){if(t.length<=i)return t;const r=t.slice(0,i),o=r.search(/\s\S*$/),e=o>0?r.slice(0,o):r;return`${e}\u2026[truncated: kept ${e.length} of ${t.length} chars]`}function h(t,r=[]){return a(u(m(t),r))}function _(t){return{sha256:d(t),bytes:Buffer.byteLength(t,"utf8")}}function l(t){return Object.keys(t??{}).map(r=>r.toLowerCase()).sort().join(",")}function O(t,r=[]){return h(f(t),r)}function y(t,r){const o=Object.entries(r).filter(([,e])=>e!==void 0&&e!=="").map(([e,n])=>typeof n=="string"?`${e}=${JSON.stringify(n)}`:`${e}=${String(n)}`).join(" ");try{s.infoPreSanitized(`${p} ${t} ${o}`)}catch{}}export{i as AUDIT_FIELD_MAX_CHARS,L as AUDIT_LOG_PREFIX,l as auditHeaderNames,h as auditInput,_ as auditOutputDigest,d as auditSha256,O as auditUrl,y as logAuditRecord,m as truncateAuditField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r="redacted",a=new Set(["access_token","api-key","api_key","apikey","assertion","auth","client_secret","code","code_verifier","id_token","id_token_hint","key","password","refresh_token","samlresponse","secret","session","sig","signature","token","x-amz-credential","x-amz-security-token","x-amz-signature"]);function n(s){let e;try{e=new URL(s)}catch{return s}for(const t of[...e.searchParams.keys()])a.has(t.toLowerCase())&&e.searchParams.set(t,r);return e.username="",e.password="",e.href}export{n as redactUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../node-crypto-polyfill.js";import{utf8ToUint8Array as u,encodeBase64URL as w,arrayBufferToBase64URL as m,decodeBase64URL as d}from"./encode.js";import{decodeJwtSignature as g}from"./decode-jwt-signature.js";import{AlgorithmTypes as s,JwtAlgorithmNotImplemented as H,JwtTokenInvalid as S,JwtTokenNotBefore as b,JwtTokenExpired as E,JwtTokenSignatureMismatched as K,CryptoKeyFormat as h,CryptoKeyUsage as l}from"./types.js";const p=
|
|
1
|
+
import"../../node-crypto-polyfill.js";import{utf8ToUint8Array as u,encodeBase64URL as w,arrayBufferToBase64URL as m,decodeBase64URL as d}from"./encode.js";import{decodeJwtSignature as g}from"./decode-jwt-signature.js";import{AlgorithmTypes as s,JwtAlgorithmNotImplemented as H,JwtTokenInvalid as S,JwtTokenNotBefore as b,JwtTokenExpired as E,JwtTokenSignatureMismatched as K,CryptoKeyFormat as h,CryptoKeyUsage as l}from"./types.js";const p=e=>{switch(e.toUpperCase()){case"HS256":return{name:"HMAC",hash:{name:"SHA-256"}};case"HS384":return{name:"HMAC",hash:{name:"SHA-384"}};case"HS512":return{name:"HMAC",hash:{name:"SHA-512"}};case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new H(e)}},A=async(e,t,n=s.HS256)=>{if(!crypto.subtle||!crypto.subtle.importKey)throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");t.startsWith("-----BEGIN PRIVATE KEY-----")&&(t=t.replace("-----BEGIN PRIVATE KEY-----","").replace("-----END PRIVATE KEY-----","").split(/\\n|\n/).join("").trim(),t=atob(t));const r=n===s.RS256||n===s.ES256,a=await crypto.subtle.importKey(r?h.PKCS8:h.RAW,r?T(t):u(t),p(n),!1,[l.Sign]);return await crypto.subtle.sign(p(n),a,u(e))};function T(e){const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let r=0,a=e.length;r<a;r++)n[r]=e.charCodeAt(r);return t}const U=async(e,t,n=s.HS256,r)=>{const a=await w(JSON.stringify(e)),i=`${await w(JSON.stringify({alg:n,typ:"JWT",kid:r}))}.${a}`,c=await m(await A(i,t,n));return`${i}.${c}`},v=async(e,t,n=s.HS256,r=!1)=>{const a=e.split(".");if(a.length!==3)throw new S;const{payload:o}=C(e),i=Math.floor(Date.now()/1e3);if(typeof o.nbf=="number"&&o.nbf>i)throw new b;if(!r&&typeof o.exp=="number"&&o.exp<=i)throw new E;const c=a.slice(0,2).join("."),f=a[2];let y=!1;if(typeof t!="string"?y=await R(c,f,t,n):y=await m(await A(c,t,n))===f,!y)throw new K;return!0},C=e=>{try{const[t,n]=e.split("."),r=JSON.parse(d(t)),a=JSON.parse(d(n));return{header:r,payload:a}}catch{throw new S}},R=async(e,t,n,r)=>{const a=await crypto.subtle.importKey("jwk",n,p(r),!1,[l.Verify]);return await crypto.subtle.verify(p(r),a,g(t),u(e))};export{C as decode,U as sign,v as verify};
|
|
@@ -5,16 +5,16 @@ export declare class JwtAlgorithmNotImplemented extends Error {
|
|
|
5
5
|
constructor(token: string);
|
|
6
6
|
}
|
|
7
7
|
export declare class JwtTokenInvalid extends Error {
|
|
8
|
-
constructor(
|
|
8
|
+
constructor();
|
|
9
9
|
}
|
|
10
10
|
export declare class JwtTokenNotBefore extends Error {
|
|
11
|
-
constructor(
|
|
11
|
+
constructor();
|
|
12
12
|
}
|
|
13
13
|
export declare class JwtTokenExpired extends Error {
|
|
14
|
-
constructor(
|
|
14
|
+
constructor();
|
|
15
15
|
}
|
|
16
16
|
export declare class JwtTokenSignatureMismatched extends Error {
|
|
17
|
-
constructor(
|
|
17
|
+
constructor();
|
|
18
18
|
}
|
|
19
19
|
export declare enum AlgorithmTypes {
|
|
20
20
|
HS256 = "HS256",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class o extends Error{constructor(
|
|
1
|
+
class o extends Error{constructor(i){super(`invalid JWT token: ${i}`),this.name="JwtAlgorithmNotImplemented"}}class s extends Error{constructor(){super("invalid JWT token"),this.name="JwtTokenInvalid"}}class c extends Error{constructor(){super("token is being used before it's valid"),this.name="JwtTokenNotBefore"}}class d extends Error{constructor(){super("token expired"),this.name="JwtTokenExpired"}}class a extends Error{constructor(){super("token signature mismatched"),this.name="JwtTokenSignatureMismatched"}}var r;(function(e){e.HS256="HS256",e.HS384="HS384",e.HS512="HS512",e.RS256="RS256",e.ES256="ES256"})(r||(r={}));var t;(function(e){e.RAW="raw",e.PKCS8="pkcs8",e.SPKI="spki",e.JWK="jwk"})(t||(t={}));var n;(function(e){e.Ecrypt="encrypt",e.Decrypt="decrypt",e.Sign="sign",e.Verify="verify",e.Deriverkey="deriveKey",e.DeriveBits="deriveBits",e.WrapKey="wrapKey",e.UnwrapKey="unwrapKey"})(n||(n={}));export{r as AlgorithmTypes,t as CryptoKeyFormat,n as CryptoKeyUsage,o as JwtAlgorithmNotImplemented,d as JwtTokenExpired,s as JwtTokenInvalid,c as JwtTokenNotBefore,a as JwtTokenSignatureMismatched};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{withPathPrefix as
|
|
1
|
+
import{withPathPrefix as o}from"@redocly/theme/core/utils";import{OTEL_EXCLUDED_ROUTES as m}from"../../constants/common.js";import{telemetryTraceStep as d}from"../../telemetry/helpers/trace-step.js";import{redactUrl as a}from"../../utils/redact-url.js";import{getClientIp as h}from"../utils/get-client-ip.js";function f(){return async(t,r)=>{if(m.some(e=>t.req.path===o(e)))return r();await d("com.redocly.request.performed",async e=>{const i=a(t.req.url);e?.setAttribute("id",t.req.path||""),e?.setAttribute("object","request"),e?.setAttribute("uri",i),e?.setAttribute("method",t.req.method||""),e?.setAttribute("host",t.req.header("host")||""),e?.setAttribute("url",i),e?.setAttribute("path",t.req.path||""),e?.setAttribute("user_agent",t.req.header("user-agent")||"");const s=t.get("auth")?.claims?.id||t.get("auth")?.claims?.sub,u=h(t.req.raw)||t.req.raw.context.remoteAddr?.ipAddress;e?.setAttribute("user_id",s),e?.setAttribute("user_ip",u),await r()})}}export{f as telemetryMiddleware};
|
|
@@ -40,6 +40,7 @@ export type PlanGates = {
|
|
|
40
40
|
[FEATURE.gatewayFetchRatePerMin]: number;
|
|
41
41
|
[FEATURE.gatewayFetchQuotaPerDay]: number;
|
|
42
42
|
[FEATURE.gatewayFetchBudgetPerExec]: number;
|
|
43
|
+
[FEATURE.cookieConsent]: boolean;
|
|
43
44
|
};
|
|
44
45
|
export type Entitlements = {
|
|
45
46
|
[key in Feature]: boolean | number | string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/realm",
|
|
3
|
-
"version": "0.138.0-next.
|
|
3
|
+
"version": "0.138.0-next.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,13 +33,13 @@
|
|
|
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.3.0-next.
|
|
37
|
-
"@redocly/config": "0.
|
|
36
|
+
"@redocly/api-docs": "0.3.0-next.3",
|
|
37
|
+
"@redocly/config": "0.58.0",
|
|
38
38
|
"@redocly/openapi-core": "2.53.0",
|
|
39
39
|
"@redocly/portal-legacy-ui": "0.19.0",
|
|
40
40
|
"@redocly/portal-plugin-mock-server": "0.22.0",
|
|
41
|
-
"@redocly/realm-asyncapi-sdk": "0.16.0-next.
|
|
42
|
-
"@redocly/theme": "0.70.0-next.
|
|
41
|
+
"@redocly/realm-asyncapi-sdk": "0.16.0-next.1",
|
|
42
|
+
"@redocly/theme": "0.70.0-next.3",
|
|
43
43
|
"@shikijs/transformers": "3.21.0",
|
|
44
44
|
"@tanstack/react-query": "5.62.3",
|
|
45
45
|
"@tanstack/react-table": "8.21.3",
|