@redocly/realm 0.134.0 → 0.135.0-next.0

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @redocly/realm
2
2
 
3
+ ## 0.135.0-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 6e84a3b2458: Enter prerelease mode.
8
+ - ed64b3849b8: Fixed an issue where italic or bold text inside headings was excluded from generated anchor links.
9
+ - Updated dependencies [6e84a3b2458]
10
+ - @redocly/portal-plugin-mock-server@0.20.0-next.0
11
+ - @redocly/realm-asyncapi-sdk@0.13.0-next.0
12
+ - @redocly/portal-legacy-ui@0.18.0-next.0
13
+ - @redocly/asyncapi-docs@1.12.0-next.0
14
+ - @redocly/graphql-docs@1.12.0-next.0
15
+ - @redocly/openapi-docs@3.23.0-next.0
16
+ - @redocly/theme@0.67.0-next.0
17
+
3
18
  ## 0.134.0
4
19
 
5
20
  ### Minor Changes
@@ -1,2 +1,2 @@
1
- import{isPrimitive as n}from"../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as p}from"./get-variable.js";import{isNode as a}from"./guards/is-node.js";import{isTag as l}from"./guards/is-tag.js";import{isCodeNode as c}from"./guards/is-code-node.js";import{isConditionalNode as d}from"./guards/is-conditional-node.js";import{isExampleNode as u}from"./guards/is-example-node.js";import{isFenceNode as h}from"./guards/is-fence-node.js";import{isTextNode as N}from"./guards/is-text-node.js";import{isFunction as b}from"./guards/is-function.js";import{isVariable as g}from"./guards/is-variable.js";function t(m,r={}){const{isTrim:s=!0}=r,i=[];for(const e of m){if(n(e))i.push(String(e));else if(a(e))if(e.type==="tr"&&i.push(`
2
- `),N(e)||c(e)||h(e))i.push(t([o(e,"content")],r));else if(u(e))i.push(t(e.children.map(f=>o(f,"content")),r));else{if(d(e)&&r.skipConditionals)continue;i.push(t(e.children,r))}else l(e)&&e.name==="code"?i.push(t(e.children,r)):b(e)&&i.push(t(Object.values(e.parameters),r));g(e)&&i.push(t([p(e,r.variables)],r))}return s?i.map(e=>e.trim()).join(" ").trim():i.join(" ")}export{t as getInnerText};
1
+ import{isPrimitive as n}from"../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as p}from"./get-variable.js";import{isNode as l}from"./guards/is-node.js";import{isTag as a}from"./guards/is-tag.js";import{isCodeNode as u}from"./guards/is-code-node.js";import{isConditionalNode as c}from"./guards/is-conditional-node.js";import{isExampleNode as d}from"./guards/is-example-node.js";import{isFenceNode as h}from"./guards/is-fence-node.js";import{isTextNode as N}from"./guards/is-text-node.js";import{isFunction as b}from"./guards/is-function.js";import{isVariable as g}from"./guards/is-variable.js";function t(m,r={}){const{isTrim:s=!0}=r,e=[];for(const i of m){if(n(i))e.push(String(i));else if(l(i))if(i.type==="tr"&&e.push(`
2
+ `),N(i)||u(i)||h(i))e.push(t([o(i,"content")],r));else if(d(i))e.push(t(i.children.map(f=>o(f,"content")),r));else{if(c(i)&&r.skipConditionals)continue;e.push(t(i.children,r))}else a(i)?e.push(t(i.children,r)):b(i)&&e.push(t(Object.values(i.parameters),r));g(i)&&e.push(t([p(i,r.variables)],r))}return s?e.map(i=>i.trim()).join(" ").trim():e.join(" ")}export{t as getInnerText};
@@ -1 +1 @@
1
- import{and as w,eq as i,isNotNull as h,lt as A,sql as E}from"drizzle-orm";import{logger as d}from"../../../tools/notifiers/logger.js";import{cacheTable as a}from"../../../providers/database/databases/sqlite-db/schemas/cache-table.js";const c="catalog-publisher-locks",T="catalog-entities::publisher",f=`${T}::remote-publish-lock`,m=1800*1e3,p=Math.floor(m/1e3),y=60*1e3,I=300*1e3,O=1e3;class n{static async getInternalCacheValue({remoteConnection:t,key:e}){return(await t.client.client.select({value:a.value}).from(a).where(w(i(a.key,e),i(a.namespace,c))).get())?.value??null}static async upsertInternalCacheValue({remoteConnection:t,key:e,value:r,ttl:s=null}){const o=new Date().toISOString();await t.client.client.insert(a).values({key:e,namespace:c,value:r,ttl:s,createdAt:o,updatedAt:o}).onConflictDoUpdate({target:[a.key],set:{namespace:c,value:r,ttl:s,updatedAt:o}}).run()}static async runUnderRemotePublishLock({runId:t,remoteConnection:e,run:r}){const s=JSON.stringify({ownerRunId:t});await n.#a({runId:t,lockValue:s,remoteConnection:e});const o=n.#r({runId:t,lockValue:s,remoteConnection:e}),u=await n.#n(r);clearInterval(o);const l=await n.#s({lockValue:s,remoteConnection:e});if(!u.ok)throw l&&d.warn(`Failed to release remote publish lock after publish error for runId=${t}: ${n.#t(l)}`),n.#e(u.error,`Remote publish failed for runId=${t}: ${n.#t(u.error)}`);if(l)throw n.#e(l,`Failed to release remote publish lock for runId=${t}: ${n.#t(l)}`);return u.result}static async#a({runId:t,lockValue:e,remoteConnection:r}){if(!await n.#i({lockValue:e,remoteConnection:r,timeoutMs:I}))throw new Error(`Timed out waiting for remote publish lock. runId=${t}`)}static#r({runId:t,lockValue:e,remoteConnection:r}){return setInterval(()=>{n.#l({remoteConnection:r,lockValue:e}).catch(s=>{d.warn(`Failed to refresh remote publish lock for runId=${t}: ${n.#t(s)}`)})},y)}static async#n(t){try{return{ok:!0,result:await t()}}catch(e){return{ok:!1,error:e}}}static async#s({lockValue:t,remoteConnection:e}){try{return await n.#c({remoteConnection:e,lockValue:t}),null}catch(r){return r}}static async#i({lockValue:t,remoteConnection:e,timeoutMs:r}){const s=Date.now();for(;Date.now()-s<r;){if(await n.#o({remoteConnection:e,lockValue:t}))return!0;await n.#w(O)}return d.warn("Lock wait timeout. Wait for the other build to finish publishing entities."),!1}static async#o({remoteConnection:t,lockValue:e}){const r=t.client.client,s=new Date().toISOString();await r.delete(a).where(w(i(a.key,f),i(a.namespace,c),h(a.ttl),A(E`datetime(${a.createdAt}, '+' || ${a.ttl} || ' seconds')`,E`datetime('now')`))).run();try{return await r.insert(a).values({key:f,namespace:c,value:e,ttl:p,createdAt:s,updatedAt:s}).run(),!0}catch(o){if(n.#u(o))return!1;throw o}}static async#c({remoteConnection:t,lockValue:e}){await t.client.client.delete(a).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run()}static async#l({remoteConnection:t,lockValue:e}){const r=new Date().toISOString();await t.client.client.update(a).set({ttl:p,createdAt:r,updatedAt:r}).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run()}static#u(t){return t instanceof Error?t.message.toLowerCase().includes("unique constraint failed"):!1}static#w(t){return new Promise(e=>setTimeout(e,t))}static#e(t,e){return t instanceof Error?t:new Error(e)}static#t(t){return t instanceof Error?t.message:typeof t=="string"?t:JSON.stringify(t)}}export{c as INTERNAL_CATALOG_PUBLISH_CACHE_NAMESPACE,T as INTERNAL_CATALOG_PUBLISH_KEY_PREFIX,n as RemotePublishLockService};
1
+ import{and as w,eq as i,isNotNull as A,lt as m,sql as T}from"drizzle-orm";import{logger as p}from"../../../tools/notifiers/logger.js";import{cacheTable as a}from"../../../providers/database/databases/sqlite-db/schemas/cache-table.js";import{BATCH_TRANSIENT_RETRY as d,describeTransientError as y,withTransientErrorRetry as E}from"../../../providers/database/transient-sqld-error.js";const c="catalog-publisher-locks",I="catalog-entities::publisher",f=`${I}::remote-publish-lock`,O=1800*1e3,h=Math.floor(O/1e3),_=60*1e3,g=300*1e3,C=1e3;class s{static async getInternalCacheValue({remoteConnection:t,key:e}){return(await t.client.client.select({value:a.value}).from(a).where(w(i(a.key,e),i(a.namespace,c))).get())?.value??null}static async upsertInternalCacheValue({remoteConnection:t,key:e,value:r,ttl:n=null}){const o=new Date().toISOString();await t.client.client.insert(a).values({key:e,namespace:c,value:r,ttl:n,createdAt:o,updatedAt:o}).onConflictDoUpdate({target:[a.key],set:{namespace:c,value:r,ttl:n,updatedAt:o}}).run()}static async runUnderRemotePublishLock({runId:t,remoteConnection:e,run:r}){const n=JSON.stringify({ownerRunId:t});await s.#r({runId:t,lockValue:n,remoteConnection:e});const o=s.#a({runId:t,lockValue:n,remoteConnection:e}),u=await s.#n(r);clearInterval(o);const l=await s.#s({lockValue:n,remoteConnection:e});if(!u.ok)throw l&&p.warn(`Failed to release remote publish lock after publish error for runId=${t}: ${s.#t(l)}`),s.#e(u.error,`Remote publish failed for runId=${t}: ${s.#t(u.error)}`);if(l)throw s.#e(l,`Failed to release remote publish lock for runId=${t}: ${s.#t(l)}`);return u.result}static async#r({runId:t,lockValue:e,remoteConnection:r}){if(!await s.#i({lockValue:e,remoteConnection:r,timeoutMs:g}))throw new Error(`Timed out waiting for remote publish lock. runId=${t}`)}static#a({runId:t,lockValue:e,remoteConnection:r}){return setInterval(()=>{s.#l({remoteConnection:r,lockValue:e}).catch(n=>{p.warn(`Failed to refresh remote publish lock for runId=${t}: ${s.#t(n)}`)})},_)}static async#n(t){try{return{ok:!0,result:await t()}}catch(e){return{ok:!1,error:e}}}static async#s({lockValue:t,remoteConnection:e}){try{return await s.#c({remoteConnection:e,lockValue:t}),null}catch(r){return r}}static async#i({lockValue:t,remoteConnection:e,timeoutMs:r}){const n=Date.now();for(;Date.now()-n<r;){if(await s.#o({remoteConnection:e,lockValue:t}))return!0;await s.#w(C)}return p.warn("Lock wait timeout. Wait for the other build to finish publishing entities."),!1}static async#o({remoteConnection:t,lockValue:e}){const r=t.client.client,n=new Date().toISOString();await E(()=>r.delete(a).where(w(i(a.key,f),i(a.namespace,c),A(a.ttl),m(T`datetime(${a.createdAt}, '+' || ${a.ttl} || ' seconds')`,T`datetime('now')`))).run(),d);try{return await E(()=>r.insert(a).values({key:f,namespace:c,value:e,ttl:h,createdAt:n,updatedAt:n}).run(),d),!0}catch(o){if(s.#u(o))return!1;throw o}}static async#c({remoteConnection:t,lockValue:e}){await E(()=>t.client.client.delete(a).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run(),d)}static async#l({remoteConnection:t,lockValue:e}){const r=new Date().toISOString();await E(()=>t.client.client.update(a).set({ttl:h,createdAt:r,updatedAt:r}).where(w(i(a.key,f),i(a.namespace,c),i(a.value,e))).run(),d)}static#u(t){const e=new Set;for(let r=t;r instanceof Error&&!e.has(r);r=r.cause){e.add(r);const n=r.message.toLowerCase();if(n.includes("unique constraint failed")||n.includes("sqlite_constraint_unique"))return!0}return!1}static#w(t){return new Promise(e=>setTimeout(e,t))}static#e(t,e){return t instanceof Error?t:new Error(e)}static#t(t){return t instanceof Error?y(t):typeof t=="string"?t:JSON.stringify(t)}}export{c as INTERNAL_CATALOG_PUBLISH_CACHE_NAMESPACE,I as INTERNAL_CATALOG_PUBLISH_KEY_PREFIX,s as RemotePublishLockService};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/realm",
3
- "version": "0.134.0",
3
+ "version": "0.135.0-next.0",
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/openapi-docs": "3.22.0",
95
- "@redocly/asyncapi-docs": "1.11.0",
96
- "@redocly/portal-legacy-ui": "0.17.0",
97
- "@redocly/portal-plugin-mock-server": "0.19.0",
98
- "@redocly/graphql-docs": "1.11.0",
94
+ "@redocly/asyncapi-docs": "1.12.0-next.0",
99
95
  "@redocly/config": "0.49.0",
100
- "@redocly/theme": "0.66.0",
101
- "@redocly/realm-asyncapi-sdk": "0.12.0"
96
+ "@redocly/graphql-docs": "1.12.0-next.0",
97
+ "@redocly/openapi-docs": "3.23.0-next.0",
98
+ "@redocly/portal-legacy-ui": "0.18.0-next.0",
99
+ "@redocly/portal-plugin-mock-server": "0.20.0-next.0",
100
+ "@redocly/realm-asyncapi-sdk": "0.13.0-next.0",
101
+ "@redocly/theme": "0.67.0-next.0"
102
102
  },
103
103
  "peerDependencies": {
104
104
  "react": "^19.2.4",