@redocly/replay 0.29.0-next.3 → 0.29.0-next.4
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/dist/{replay-AiChatProvider-Bnz0LDFD.js → replay-AiChatProvider-DR7NuYZo.js} +6 -6
- package/dist/{replay-AiChatProvider-C5p3nTV1.js → replay-AiChatProvider-GWJ-n-vh.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-Dfbp6Mt_.js → replay-AiChatSqliteDBStorage--C03eLtv.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-DYxoSZak.js → replay-AiChatSqliteDBStorage-BFkOn15p.js} +1 -1
- package/dist/{replay-AiPanel-BSg5Bap4.js → replay-AiPanel-1tEi12j1.js} +1 -1
- package/dist/{replay-AiPanel-C0E1A47H.js → replay-AiPanel-CXIw_O8d.js} +4 -4
- package/dist/{replay-FileWatcher-Ba9Ob_Sy.js → replay-FileWatcher-B9PZyA8D.js} +1 -1
- package/dist/{replay-FileWatcher-BiAGOR1Z.js → replay-FileWatcher-SUnXmGod.js} +2 -2
- package/dist/{replay-SemanticSearchService-sIjG5Wxe.js → replay-SemanticSearchService-BGg8Dbuq.js} +1 -1
- package/dist/{replay-SemanticSearchService-IInvoSoP.js → replay-SemanticSearchService-vr1hqPU7.js} +1 -1
- package/dist/{replay-SqliteDBStorage-DMoeVRXU.js → replay-SqliteDBStorage-DcIA3sjg.js} +1 -1
- package/dist/{replay-SqliteDBStorage-C-ovuJna.js → replay-SqliteDBStorage-lUh6lJSO.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-CB9S1PNT.js → replay-TauriFileSystemAdapter-C2c2Qy4S.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-DDo2h7gX.js → replay-TauriFileSystemAdapter-wAZBliTE.js} +1 -1
- package/dist/{replay-TauriRootStorage-CR1PyBgZ.js → replay-TauriRootStorage-CwVriXnS.js} +2 -2
- package/dist/{replay-TauriRootStorage-BX-XrEN-.js → replay-TauriRootStorage-olGW7jq5.js} +1 -1
- package/dist/{replay-agent-loop-BmoYEhOB.js → replay-agent-loop-GDXIQGy5.js} +1 -1
- package/dist/{replay-agent-loop-4YtdgkDh.js → replay-agent-loop-QLgzMDfU.js} +3 -3
- package/dist/{replay-ai-chat-mappers-42FEVsfw.js → replay-ai-chat-mappers-DFVcviEH.js} +1 -1
- package/dist/{replay-ai-chat-mappers-CgjhiNr7.js → replay-ai-chat-mappers-Dkj4vl9T.js} +1 -1
- package/dist/{replay-create-model-4Yknbfme.js → replay-create-model-D9NcJ3yx.js} +3 -3
- package/dist/{replay-create-model-kF4veQPK.js → replay-create-model-UDURpFQ4.js} +3 -3
- package/dist/{replay-db-_hwn1n5t.js → replay-db-CFx-F30d.js} +1 -1
- package/dist/{replay-db-B3tQE-B9.js → replay-db-CMt9dX-H.js} +1 -1
- package/dist/{replay-external-resolver-DX5JrdGB.js → replay-external-resolver-CPD4hskh.js} +1 -1
- package/dist/{replay-external-resolver-DS7qAi0G.js → replay-external-resolver-rqFR7T0O.js} +2 -2
- package/dist/{replay-index-BYEUJTGe.js → replay-index-0MfVkwY4.js} +1 -1
- package/dist/replay-index-BTZoG4e-.js +4 -0
- package/dist/{replay-index-BDRC1QoR.js → replay-index-CLJOTBS9.js} +1051 -1046
- package/dist/{replay-index-CtxNTrRQ.js → replay-index-CVhBLstt.js} +1 -1
- package/dist/{replay-index-Bwbd4CsO.js → replay-index-DFopWLS5.js} +146 -139
- package/dist/replay-index-DFpzg2pO.js +1 -0
- package/dist/{replay-index-KN9FLfwz.js → replay-index-DhelzkVo.js} +13856 -13819
- package/dist/{replay-index-DD1leCQo.js → replay-index-X5PC09Iq.js} +1 -1
- package/dist/{replay-lint-BvndGL38.js → replay-lint-VrViwed0.js} +48 -48
- package/dist/{replay-lint-graphql-DKP9oX8y.js → replay-lint-graphql-BytE8Msa.js} +2 -2
- package/dist/{replay-lint-graphql-CK8-ZL5Q.js → replay-lint-graphql-Cj0YxKYW.js} +1 -1
- package/dist/{replay-lint-C3ireP5A.js → replay-lint-xvdvEmuK.js} +838 -831
- package/dist/{replay-periodic-revalidation-BcWBqn6g.js → replay-periodic-revalidation-CBK4GGcK.js} +1 -1
- package/dist/{replay-periodic-revalidation-chHSyw20.js → replay-periodic-revalidation-UaQh_EiA.js} +1 -1
- package/dist/{replay-resolve-B1Kvf3fM.js → replay-resolve-B-ScAEQ_.js} +1 -1
- package/dist/{replay-resolve-DC-rmKvK.js → replay-resolve-DxLYwKrU.js} +1 -1
- package/dist/{replay-respect-run-C24QylJ-.js → replay-respect-run-BC7vr1j1.js} +21 -21
- package/dist/{replay-respect-run-DDZ9eF0k.js → replay-respect-run-C84RN_GR.js} +430 -421
- package/dist/{replay-tauri-path-Bz_q3KUG.js → replay-tauri-path-B-SLo2Ec.js} +2 -2
- package/dist/{replay-tauri-path-DBSmio5_.js → replay-tauri-path-Bl15GRY1.js} +1 -1
- package/dist/{replay-useAiChatQueries-C_GZ_b68.js → replay-useAiChatQueries-C-ZR0ZaE.js} +1 -1
- package/dist/{replay-useAiChatQueries-DQks2tVS.js → replay-useAiChatQueries-gO6Sj7A5.js} +4 -4
- package/dist/{replay-validate-key-DScTTPU4.js → replay-validate-key-CuCnpHLS.js} +1 -1
- package/dist/{replay-validate-key-c2nCLxiG.js → replay-validate-key-D5QLY_qk.js} +2 -2
- package/dist/replay.cjs +1 -1
- package/dist/replay.d.ts +7 -0
- package/dist/replay.js +1 -1
- package/package.json +4 -4
- package/dist/replay-index-CHdCQ_zw.js +0 -4
- package/dist/replay-index-r6bsSAe6.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as h, s as x, l as i } from "./replay-index-
|
|
2
|
-
import { n as j, o as b, j as k } from "./replay-index-
|
|
1
|
+
import { k as h, s as x, l as i } from "./replay-index-DhelzkVo.js";
|
|
2
|
+
import { n as j, o as b, j as k } from "./replay-index-DhelzkVo.js";
|
|
3
3
|
async function u(a, e) {
|
|
4
4
|
const t = x(), l = await i(a), c = await i(e), o = l.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), s = c.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), m = Math.min(o.length, s.length);
|
|
5
5
|
let r = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-CLJOTBS9.js");async function u(r,n){const t=e.sep(),l=await e.resolve(r),c=await e.resolve(n),a=l.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),i=c.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),m=Math.min(a.length,i.length);let s=0;for(let o=0;o<m&&a[o]===i[o];o++)s++;const p=a.slice(s).map(()=>".."),f=i.slice(s);return[...p,...f].join(t)}async function g(r){const n=await e.extname(r);return n?`.${n}`:""}exports.dirname=e.dirname;exports.isAbsolute=e.isAbsolute;exports.join=e.join;exports.resolve=e.resolve;exports.extname=g;exports.relative=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Oe=require("react"),a=require("./replay-index-
|
|
1
|
+
"use strict";const Oe=require("react"),a=require("./replay-index-CLJOTBS9.js"),m=require("./replay-db-CFx-F30d.js"),r=require("./replay-create-model-D9NcJ3yx.js"),A=require("./replay-SemanticSearchService-vr1hqPU7.js"),Ee=require("@tanstack/react-query"),M={path:"pathParameters",query:"queryParameters",header:"headers",cookie:"cookies"},mt={run_request:{approveLabel:"Run",denyLabel:"Skip"},update_step:{approveLabel:"Apply",denyLabel:"Dismiss"},update_security:{approveLabel:"Apply",denyLabel:"Dismiss"}},ht={set_active_environment:{approveLabel:"Switch",denyLabel:"Cancel"},add_environment:{approveLabel:"Add",denyLabel:"Cancel"},upsert_input:{approveLabel:"Set",denyLabel:"Cancel"},upsert_server:{approveLabel:"Set",denyLabel:"Cancel"},remove_input:{approveLabel:"Remove",denyLabel:"Cancel"},remove_server:{approveLabel:"Remove",denyLabel:"Cancel"},create_collection:{approveLabel:"Create",denyLabel:"Cancel"},create_workflow:{approveLabel:"Create",denyLabel:"Cancel"},create_step:{approveLabel:"Create",denyLabel:"Cancel"},move_step:{approveLabel:"Move",denyLabel:"Cancel"},delete_collection:{approveLabel:"Delete",denyLabel:"Cancel"},delete_workflow:{approveLabel:"Delete",denyLabel:"Cancel"},delete_step:{approveLabel:"Delete",denyLabel:"Cancel"},save_tab_to_collection:{approveLabel:"Save",denyLabel:"Cancel"}},yt={CHAT:"chat",HISTORY:"history"},It="report_status",wt="run_workflow",j={WEB_SEARCH:"web_search"};function gt(e){switch(e.provider){case a.AI_PROVIDERS.GEMINI:return{[j.WEB_SEARCH]:r.google.tools.googleSearch({})};case a.AI_PROVIDERS.OPENAI:return{[j.WEB_SEARCH]:r.openai.tools.webSearch({})};case a.AI_PROVIDERS.ANTHROPIC:return{[j.WEB_SEARCH]:r.anthropic.tools.webFetch_20250910()};case a.REUNITE_AI_PROVIDER:return{[j.WEB_SEARCH]:{type:"provider",id:"reunite.web_search",name:"web_search",args:{}}};default:return{}}}const bt=["info","workflows","sourceDescriptions"];function vt(e){const t=[];return e.collectionId&&t.push(`Collection ID: ${e.collectionId}`),e.collection?.info?.title&&t.push(`Title: ${e.collection.info.title}`),e.collection?.info?.summary&&t.push(`Summary: ${e.collection.info.summary}`),e.collection?.info?.description&&t.push(`Description: ${e.collection.info.description}`),m.buildMessageFromArray(t,`
|
|
2
2
|
`)}function Tt(e){const t=[];if(e.collection?.workflows?.length){t.push("Workflows:");for(const o of e.collection.workflows)t.push(` workflowId=${o.workflowId} ${o.summary??""}`)}return m.buildMessageFromArray(t,`
|
|
3
3
|
`)}function St(e){const t=[];if(e.collection?.sourceDescriptions?.length){t.push("Source descriptions:");for(const o of e.collection.sourceDescriptions)t.push(` name=${o.name} url=${o.url}`)}return m.buildMessageFromArray(t,`
|
|
4
4
|
`)}function kt(e,t){const o=["Current tab (collection)"];for(const n of t)switch(n){case"info":o.push(vt(e));break;case"workflows":o.push(Tt(e));break;case"sourceDescriptions":o.push(St(e));break}return m.buildMessageFromArray(o,`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useContext as Ht, createContext as Gt } from "react";
|
|
2
|
-
import { R as Vt, A as be, aP as re, aQ as Kt, aR as Jt, aS as Qt, aa as x, a as de, aF as Y, aT as mt, aU as Oe, aE as Ee, aV as ht, aW as ue, aX as Z, c as b, aY as Xt, al as G, aj as V, aZ as It, a_ as pe, ak as $e, a$ as Zt, b0 as eo, b1 as to, b2 as oo, b3 as no, b4 as ro, b5 as so, ad as K, b6 as ao, ae as ee, a8 as io, b7 as co, b8 as lo, b9 as wt, ba as yt, bb as uo, bc as vt, bd as xe, be as Ae, ag as J, bf as po, a9 as gt, bg as _e, az as bt, bh as fo, bi as mo, C as k, bj as Be, bk as ho, bl as Ye, bm as Io, bn as wo, bo as yo, a7 as kt, a6 as St } from "./replay-index-
|
|
3
|
-
import { b as C, f as Tt, a as Ct, c as Ot, d as fe, e as At, i as ze, h as Re, R as z, j as vo, k as go, p as bo, s as He, l as ko } from "./replay-db-
|
|
4
|
-
import { b as So, o as To, d as Co, e as p, u as me, f as i, h as R, j as E, n as A, k as B, m as I, q as T, r as Pe, t as te, v as he, Z as H, w as Oo, x as Ge, c as Ao, s as Eo, y as $o } from "./replay-create-model-
|
|
5
|
-
import { g as xo, e as Ve, a as _o, b as Ro, c as Ke, d as Po, f as qo } from "./replay-SemanticSearchService-
|
|
2
|
+
import { R as Vt, A as be, aP as re, aQ as Kt, aR as Jt, aS as Qt, aa as x, a as de, aF as Y, aT as mt, aU as Oe, aE as Ee, aV as ht, aW as ue, aX as Z, c as b, aY as Xt, al as G, aj as V, aZ as It, a_ as pe, ak as $e, a$ as Zt, b0 as eo, b1 as to, b2 as oo, b3 as no, b4 as ro, b5 as so, ad as K, b6 as ao, ae as ee, a8 as io, b7 as co, b8 as lo, b9 as wt, ba as yt, bb as uo, bc as vt, bd as xe, be as Ae, ag as J, bf as po, a9 as gt, bg as _e, az as bt, bh as fo, bi as mo, C as k, bj as Be, bk as ho, bl as Ye, bm as Io, bn as wo, bo as yo, a7 as kt, a6 as St } from "./replay-index-DhelzkVo.js";
|
|
3
|
+
import { b as C, f as Tt, a as Ct, c as Ot, d as fe, e as At, i as ze, h as Re, R as z, j as vo, k as go, p as bo, s as He, l as ko } from "./replay-db-CMt9dX-H.js";
|
|
4
|
+
import { b as So, o as To, d as Co, e as p, u as me, f as i, h as R, j as E, n as A, k as B, m as I, q as T, r as Pe, t as te, v as he, Z as H, w as Oo, x as Ge, c as Ao, s as Eo, y as $o } from "./replay-create-model-UDURpFQ4.js";
|
|
5
|
+
import { g as xo, e as Ve, a as _o, b as Ro, c as Ke, d as Po, f as qo } from "./replay-SemanticSearchService-BGg8Dbuq.js";
|
|
6
6
|
import { useInfiniteQuery as No, useQuery as Uo } from "@tanstack/react-query";
|
|
7
7
|
const se = {
|
|
8
8
|
path: "pathParameters",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./replay-create-model-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./replay-create-model-D9NcJ3yx.js"),n=require("./replay-index-CLJOTBS9.js"),l=require("./replay-defaults-DVvOnvnR.js");async function s(t,a,o,i){try{const e=r.createModel({provider:t,modelId:o,apiKey:a});return await r.generateText({model:e,prompt:l.VALIDATION_PROMPT,maxOutputTokens:n.MAX_OUTPUT_TOKENS_FOR_VALIDATION,abortSignal:i?.abortSignal}),{valid:!0}}catch(e){if(e instanceof Error&&e.name==="AbortError")throw e;return{valid:!1,error:e instanceof Error&&e.message.length>0?e.message:"Validation failed. Please try again."}}}exports.validateApiKey=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as i, g as n } from "./replay-create-model-
|
|
2
|
-
import { M as s } from "./replay-index-
|
|
1
|
+
import { c as i, g as n } from "./replay-create-model-UDURpFQ4.js";
|
|
2
|
+
import { M as s } from "./replay-index-DhelzkVo.js";
|
|
3
3
|
import { V as l } from "./replay-defaults-CzR6jw9a.js";
|
|
4
4
|
async function g(a, e, t, o) {
|
|
5
5
|
try {
|
package/dist/replay.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-CLJOTBS9.js"),t=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");exports.AI_PROVIDERS=e.AI_PROVIDERS;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.REUNITE_AI_PROVIDER=e.REUNITE_AI_PROVIDER;exports.Replay=e.Replay;exports.ReplayOverlay=e.ReplayOverlay;Object.defineProperty(exports,"SpanStatusCode",{enumerable:!0,get:()=>e.SpanStatusCode});exports.TelemetryClient=e.TelemetryClient;exports.applyThemeToDOM=e.applyThemeToDOM;exports.createResource=e.createResource;exports.getCurrentTheme=e.getCurrentTheme;exports.loadAgentLoop=e.loadAgentLoop;exports.makeProviderRecord=e.makeProviderRecord;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.validateApiKey=e.validateApiKey;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
|
package/dist/replay.d.ts
CHANGED
|
@@ -460,6 +460,13 @@ declare type OpenAPIOperation_2 = {
|
|
|
460
460
|
};
|
|
461
461
|
servers: Server[];
|
|
462
462
|
security?: OperationSecurity[][];
|
|
463
|
+
responses?: {
|
|
464
|
+
[status: string]: {
|
|
465
|
+
mediaTypes?: {
|
|
466
|
+
[name: string]: Pick<MediaType, 'schema'>;
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
};
|
|
463
470
|
response?: Response_2 | null;
|
|
464
471
|
};
|
|
465
472
|
|
package/dist/replay.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, av as r, bN as t, bO as l, R as o, bP as b, bQ as R, K as d, bR as m, bS as p, L as n, bT as u, bU as y, bV as A, bW as T, au as i, at as O, bX as h, bY as E } from "./replay-index-
|
|
1
|
+
import { A as s, av as r, bN as t, bO as l, R as o, bP as b, bQ as R, K as d, bR as m, bS as p, L as n, bT as u, bU as y, bV as A, bW as T, au as i, at as O, bX as h, bY as E } from "./replay-index-DhelzkVo.js";
|
|
2
2
|
import { O as v, h as C } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
|
|
3
3
|
export {
|
|
4
4
|
s as AI_PROVIDERS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/replay",
|
|
3
|
-
"version": "0.29.0-next.
|
|
3
|
+
"version": "0.29.0-next.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/replay.cjs",
|
|
6
6
|
"module": "./dist/replay.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@redocly/theme": "0.70.0-next.
|
|
19
|
+
"@redocly/theme": "0.70.0-next.4",
|
|
20
20
|
"@tanstack/react-query": "5.62.3",
|
|
21
21
|
"react": "^19.2.7",
|
|
22
22
|
"react-dom": "^19.2.7",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@lezer/highlight": "^1.1.6",
|
|
52
52
|
"@noble/hashes": "^1.8.0",
|
|
53
53
|
"@opentelemetry/api": "1.9.1",
|
|
54
|
-
"@redocly/openapi-core": "2.
|
|
54
|
+
"@redocly/openapi-core": "2.55.0",
|
|
55
55
|
"@redocly/replay-asyncapi-sdk": "0.0.1",
|
|
56
|
-
"@redocly/respect-core": "2.
|
|
56
|
+
"@redocly/respect-core": "2.55.0",
|
|
57
57
|
"@redocly/vscode-json-languageservice": "^3.4.9",
|
|
58
58
|
"@tauri-apps/api": "2.4.1",
|
|
59
59
|
"@tauri-apps/plugin-deep-link": "^2.4.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./replay-index-BDRC1QoR.js"),s=require("./replay-lint-BvndGL38.js"),o=require("./replay-resolve-B1Kvf3fM.js");function j(e){return(p.pathBrowserifyExports.extname(e)===".yaml"||p.pathBrowserifyExports.extname(e)===".yml")&&!1}function k(e){return p.isPlainObject(e)&&!s.isEmptyObject(e)}async function L(e){return new Promise(t=>setTimeout(t,e))}const S="type",v=["api-description","api-operation","data-schema"];function R(e,t){const{ctx:n}=s.getNodeTypesFromJSONSchema("EntityFileDefault",t),{ctx:r,discriminatorResolver:i}=s.getNodeTypesFromJSONSchema("EntityFile",e);return{entityTypes:{...n,...r,EntityFileArray:{properties:{},items:y=>{if(p.isPlainObject(y)){const m=y[S];if(!m)return"Entity";const l=i?.(y,m);if(l&&typeof l=="string")return l}return"Entity"}}},discriminatorResolver:i}}function c(e,t){if(o.isRef(t.parent))return;const n=t.key.toString(),r=e.counts??={};r[n]=(r[n]??0)+1}function O(e){for(const i of Object.values(e))i.items&&(i.total=i.items.size);const{xExtensions:t}=e,n=t.counts??{},r=Object.keys(n).sort();t.total=r.length,t.counts=Object.fromEntries(r.map(i=>[i,n[i]]))}const w=e=>({SpecExtension:{enter(t,n){c(e.xExtensions,n)}},XCodeSampleList:{enter(t,n){c(e.xExtensions,n)}},ExamplesMap:{enter(t,n){n.key.toString()==="x-examples"&&c(e.xExtensions,n)}},EnumDescriptions:{enter(t,n){c(e.xExtensions,n)}},TagGroups:{enter(t,n){c(e.xExtensions,n)}},Logo:{enter(t,n){c(e.xExtensions,n)}},XServerList:{enter(t,n){c(e.xExtensions,n)}},XUsePkce:{enter(t,n){c(e.xExtensions,n)}},Operation:{enter(t,n){n.key.toString()==="x-query"&&c(e.xExtensions,n)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(t){e.refs.items.add(t.$ref)}},Tag:{leave(t){e.tags.items.add(t.name)}},Link:{leave(t){e.links.items.add(t.operationId)}},WebhooksMap:{enter(t,n){n.key.toString()==="x-webhooks"&&c(e.xExtensions,n)},Operation:{leave(t){if(e.webhooks.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}}},Paths:{PathItem:{leave(){e.pathItems.total++},Operation:{leave(t){if(e.operations.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}},Parameter:{leave(t){e.parameters.items.add(t.name)}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),z=e=>({SpecExtension:{enter(t,n){c(e.xExtensions,n)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(t){e.refs.items.add(t.$ref)}},Tag:{leave(t){e.tags.items.add(t.name)}},ChannelMap:{Channel:{leave(){e.channels.total++},Operation:{leave(t){if(e.operations.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}},Parameter:{leave(t,{key:n}){e.parameters.items.add(n.toString())}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),V=e=>({SpecExtension:{enter(t,n){c(e.xExtensions,n)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(t){e.refs.items.add(t.$ref)}},Tag:{leave(t){e.tags.items.add(t.name)}},NamedChannels:{Channel:{leave(){e.channels.total++},Parameter:{leave(t,{key:n}){e.parameters.items.add(n.toString())}}}},NamedOperations:{Operation:{leave(t){if(e.operations.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),G=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,b=2,x=150,U=()=>({any(e,{report:t,location:n}){if(p.isPlainObject(e)&&"key"in e){const r=e.key;if(typeof r!="string"){t({message:"Entity `key` must be a string.",location:n.child(["key"])});return}r.length<b&&t({message:`Entity 'key' must be at least ${b} characters long.`,location:n.child(["key"])}),r.length>x&&t({message:`Entity 'key' must not exceed ${x} characters.`,location:n.child(["key"])}),G.test(r)||t({message:"Entity `key` must contain only lowercase letters, numbers, and hyphens, and cannot start or end with a hyphen.",location:n.child(["key"])})}}});function P(e,t){const r=t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")+e;return Object.values(s.t).includes(r)?r:e}function B(e,t){const n={};for(const[r,i]of Object.entries(t))if(_(r,i)){if(i.severity==="off")continue;n[r]={...q(e,r,i)}}else n[r]=i;return n}function M(e){const t={},n={};for(const[r,i]of Object.entries(e))if(_(r,i)){const a=i;$(a)?t[r]=a:n[r]=a}else n[r]=i;return{entityRules:t,apiRules:n}}function Y(e,t,n){if(!p.isPlainObject(n.parsed)||!p.isPlainObject(n.parsed.components))return null;const r=n.parsed.components,i="schemas"in r?r.schemas:void 0;if(!i||!(e in i))return null;const a=i[e];try{const y=JSON.parse(t);if(s.dequal(a,y))return a}catch{return null}return null}function _(e,t){return e.startsWith("rule/")&&p.isPlainObject(t)}function $(e){return Object.values(s.t).some(t=>e.subject.type===t)}function q(e,t,n){const r=P(n.subject.type,e),i=n.where?.map(a=>({...a,subject:{...a.subject,type:P(a.subject.type,e)}}));return{assertionId:t,subject:{...n.subject,type:r},assertions:n.assertions,...i&&{where:i},...n.message&&{message:n.message},...n.severity&&{severity:n.severity}}}async function N(e){const{document:t,entitySchema:n,entityDefaultSchema:r,severity:i,externalRefResolver:a=new o.BaseResolver,assertionConfig:y={}}=e,m={problems:[],specVersion:"entity",visitorsData:{}},{entityTypes:l,discriminatorResolver:g}=R(n,r),d=o.normalizeTypes(l);let f=d.Entity;if(Array.isArray(t.parsed))f=d.EntityFileArray;else if(p.isPlainObject(t.parsed)){const h=t.parsed[S];if(!h)f=d.Entity;else{const T=g?.(t.parsed,h);T&&typeof T=="string"&&d[T]&&(f=d[T])}}const E=s.Assertions(y),u=Array.isArray(E)?E.map(h=>({severity:i||"error",ruleId:"entity assertions",visitor:h})):[{severity:i||"error",ruleId:"entity assertions",visitor:E}],C=[{severity:i||"error",ruleId:"entity struct",visitor:s.Struct()},{severity:i||"error",ruleId:"entity no-unresolved-refs",visitor:s.NoUnresolvedRefs()},{severity:i||"error",ruleId:"entity key-valid",visitor:U()},...u],D=s.normalizeVisitors(C,d),F=await o.resolveDocument({rootDocument:t,rootType:f,externalRefResolver:a});return s.walkDocument({document:t,rootType:f,normalizedVisitors:D,resolvedRefMap:F,ctx:m}),m.problems}async function A(e,t,n){if(!t.rules)throw new Error(`Scorecard level "${t.name}" has no rules defined.`);const r=new o.BaseResolver,i=o.makeDocumentFromString(JSON.stringify(e,null,2),"entity"),a=i.parsed[S],y=B(a||"unknown",t.rules),{entityRules:m,apiRules:l}=M(y),g=await N({document:i,entitySchema:s.Js,entityDefaultSchema:s.Ls,externalRefResolver:r,assertionConfig:m});if(v.includes(e.type)){if(Object.keys(l).length===0)return g;if(!n)throw new Error(`Document is required for entity type "${e.type}". Provide the source API document to lint API rules.`);if(e.type==="data-schema"&&e.metadata?.schema){Object.values(l).forEach(u=>{if(p.isPlainObject(u)&&p.isPlainObject(u.subject)&&u.subject.type!=="Schema")throw new Error(`API rules for "data-schema" entity must target Schema subject, but found "${u.subject.type}".`)});const f=Y(e.title,e.metadata.schema,n);if(!f)throw new Error(`Schema "${e.title}" not found in the document. Ensure the schema exists in components.schemas.`);const E=await I({schema:f,schemaKey:e.title,config:await s.createConfig({rules:l}),specType:e.metadata.specType,sourceDocument:n,externalRefResolver:r});return[...g,...E]}const d=await s.lintDocument({document:n,externalRefResolver:r,config:await s.createConfig({rules:l})});return[...g,...d]}else if(!s.isEmptyObject(l))throw new Error(`API rules are not supported for entity type "${e.type}". Only ${v.join(", ")} support API rules.`);return g}async function I(e){const{schema:t,schemaKey:n,config:r,sourceDocument:i,specType:a,externalRefResolver:y=new o.BaseResolver(r.resolve)}=e,m=i.parsed,l=m[a],g=m.info,d=o.makeDocumentFromString(JSON.stringify({[a]:l,info:g,components:{schemas:{[n]:t}}},null,2),i?.source.absoluteRef||`schema:${n}`);return(await s.lintDocument({document:d,config:r,externalRefResolver:y})).filter(E=>E.location.some(u=>u.pointer?.includes(`/components/schemas/${n}`)))}class J extends Error{}exports.isPlainObject=p.isPlainObject;exports.Arazzo1Types=s.Arazzo1Types;exports.Arazzo1_1Types=s.Arazzo1_1Types;exports.AsyncApi2Types=s.AsyncApi2Types;exports.AsyncApi3Types=s.AsyncApi3Types;exports.CONFIG_BUNDLER_VISITOR_ID=s.CONFIG_BUNDLER_VISITOR_ID;exports.CONFIG_FILE_NAME=s.CONFIG_FILE_NAME;exports.Config=s.Config;exports.ConfigTypes=s.ConfigTypes;exports.ConfigValidationError=s.ConfigValidationError;exports.DEFAULT_CONFIG=s.DEFAULT_CONFIG;exports.DEFAULT_PROJECT_PLUGIN_PATHS=s.DEFAULT_PROJECT_PLUGIN_PATHS;exports.IGNORE_BANNER=s.IGNORE_BANNER;exports.IGNORE_FILE=s.IGNORE_FILE;exports.Oas2Types=s.Oas2Types;exports.Oas3Types=s.Oas3Types;exports.Oas3_1Types=s.Oas3_1Types;exports.Oas3_2Types=s.Oas3_2Types;exports.OpenRpcTypes=s.OpenRpcTypes;exports.Overlay1Types=s.Overlay1Types;exports.PLUGINS_COLLECTOR_VISITOR_ID=s.PLUGINS_COLLECTOR_VISITOR_ID;exports.bundle=s.bundle;exports.bundleDocument=s.bundleDocument;exports.bundleFromString=s.bundleFromString;exports.clearPluginsCache=s.clearPluginsCache;exports.createConfig=s.createConfig;exports.createConfigTypes=s.createConfigTypes;exports.dequal=s.dequal;exports.detectSpec=s.detectSpec;exports.findConfig=s.findConfig;exports.formatProblems=s.formatProblems;exports.getAstNodeByPointer=s.getAstNodeByPointer;exports.getCodeframe=s.getCodeframe;exports.getLineColLocation=s.getLineColLocation;exports.getMajorSpecVersion=s.getMajorSpecVersion;exports.getPluginCacheVersion=s.getPluginCacheVersion;exports.getTotals=s.getTotals;exports.getTypes=s.getTypes;exports.isEmptyObject=s.isEmptyObject;exports.isNotEmptyArray=s.isNotEmptyArray;exports.isString=s.isString;exports.keysOf=s.keysOf;exports.lint=s.lint;exports.lintConfig=s.lintConfig;exports.lintDocument=s.lintDocument;exports.lintFromString=s.lintFromString;exports.loadConfig=s.loadConfig;exports.loadIgnoreConfig=s.loadIgnoreConfig;exports.logger=s.logger;exports.mapTypeToComponent=s.mapTypeToComponent;exports.normalizeVisitors=s.normalizeVisitors;exports.pluralize=s.pluralize;exports.regexFromString=s.regexFromString;exports.resolvePlugins=s.resolvePlugins;exports.slash=s.slash;exports.validate=s.lint;exports.walkDocument=s.walkDocument;exports.xmlEscape=s.xmlEscape;exports.BaseResolver=o.BaseResolver;exports.ResolveError=o.ResolveError;exports.Source=o.Source;exports.YamlParseError=o.YamlParseError;exports.escapePointerFragment=o.escapePointerFragment;exports.getDir=o.getDir;exports.isAbsoluteUrl=o.isAbsoluteUrl;exports.isBrowser=o.isBrowser;exports.isGraphqlRef=o.isGraphqlRef;exports.isMappingRef=o.isMappingRef;exports.isRef=o.isRef;exports.isSupportedExtension=o.isSupportedExtension;exports.isTruthy=o.isTruthy;exports.makeDocumentFromString=o.makeDocumentFromString;exports.normalizeTypes=o.normalizeTypes;exports.parseYaml=o.parseYaml;exports.readFileFromUrl=o.readFileFromUrl;exports.resolveDocument=o.resolveDocument;exports.resolvePath=o.resolvePath;exports.stringifyYaml=o.stringifyYaml;exports.unescapePointerFragment=o.unescapePointerFragment;exports.HandledError=J;exports.StatsAsync2=z;exports.StatsAsync3=V;exports.StatsOAS=w;exports.createEntityTypes=R;exports.doesYamlFileExist=j;exports.isNotEmptyObject=k;exports.lintEntityFile=N;exports.lintEntityWithScorecardLevel=A;exports.lintSchema=I;exports.pause=L;
|