@redocly/cli 2.54.1 → 2.54.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.
Files changed (118) hide show
  1. package/THIRD_PARTY_NOTICES +2 -2
  2. package/lib/chunks/{KW7NKDOX.js → 2FXTKF3U.js} +1 -1
  3. package/lib/chunks/{23QBFBKB.js → 32ZHA42N.js} +1 -1
  4. package/lib/chunks/{IZ2TZVJD.js → 3TYRUZAW.js} +4 -4
  5. package/lib/chunks/{RVQFQGGH.js → 4R5G4SNU.js} +1 -1
  6. package/lib/chunks/5OBAGRRJ.js +78 -0
  7. package/lib/chunks/{AHGQ4BNI.js → 77KV43X2.js} +1 -1
  8. package/lib/chunks/B6JQC3AM.js +30 -0
  9. package/lib/chunks/{Q7ARG2G6.js → BABBSLVN.js} +1 -1
  10. package/lib/chunks/{C27G2ZXO.js → BZWFV3MX.js} +1 -1
  11. package/lib/chunks/{H4XURXR7.js → CUB5GMHZ.js} +1 -1
  12. package/lib/chunks/{J7GIHRZA.js → DE4ZFTDG.js} +1 -1
  13. package/lib/chunks/{UAEEHSSK.js → DFVJG4OO.js} +2 -2
  14. package/lib/chunks/{KZMFETIJ.js → FDI3NUCB.js} +1 -1
  15. package/lib/chunks/{XRZ5NMQ5.js → G66T7F2A.js} +1 -1
  16. package/lib/chunks/{3BJIJBSJ.js → GKBR6HC7.js} +1 -1
  17. package/lib/chunks/GTBZLPVY.js +7 -0
  18. package/lib/chunks/{Y6E4JAM3.js → HITQPK62.js} +1 -1
  19. package/lib/chunks/{ALXOGCUM.js → HNVJYHEV.js} +1 -1
  20. package/lib/chunks/{3RDMQ5CQ.js → HPJKQNL7.js} +1 -1
  21. package/lib/chunks/{KEF4233Y.js → HR7ZTPFZ.js} +1 -1
  22. package/lib/chunks/HYALAA3H.js +7 -0
  23. package/lib/chunks/{VTKYS75A.js → I44GHHET.js} +1 -1
  24. package/lib/chunks/{CI4NGJ3I.js → ITRAFA2I.js} +1 -1
  25. package/lib/chunks/K2PGWUA3.js +9 -0
  26. package/lib/chunks/{W6X4HEU3.js → KCRCWPLX.js} +3 -3
  27. package/lib/chunks/KPWZVETN.js +11 -0
  28. package/lib/chunks/{YDSFHQXH.js → KVPIWPOL.js} +1 -1
  29. package/lib/chunks/{2MBZI3W3.js → KZPCQAG3.js} +1 -1
  30. package/lib/chunks/{RW2ESAIF.js → L2EEGRZN.js} +41 -41
  31. package/lib/chunks/{UYHX7364.js → LFQ7H446.js} +1 -1
  32. package/lib/chunks/LWDUZ2W4.js +7 -0
  33. package/lib/chunks/{IW2J6X26.js → LZRNA4HH.js} +1 -1
  34. package/lib/chunks/{UWNBPAWG.js → NRAZJDJM.js} +1 -1
  35. package/lib/chunks/{MZCEUZSS.js → NRCWSDXN.js} +1 -1
  36. package/lib/chunks/{S4H3MC5R.js → OA5XCUEZ.js} +1 -1
  37. package/lib/chunks/OJUJ2R6B.js +20 -0
  38. package/lib/chunks/{SAJRBHEI.js → OW3COOIS.js} +1 -1
  39. package/lib/chunks/{LT2PEIAT.js → OYAP4QAE.js} +1 -1
  40. package/lib/chunks/{4G34OIRT.js → PZLKJXIF.js} +1 -1
  41. package/lib/chunks/{ZBK7SJHM.js → PZTYMEH7.js} +1 -1
  42. package/lib/chunks/{ZDQDZTQ7.js → RAYH3MG6.js} +1 -1
  43. package/lib/chunks/{2TLIBL23.js → SJCEHWE2.js} +1 -1
  44. package/lib/chunks/{2NS7AGPD.js → SN3OGJPW.js} +1 -1
  45. package/lib/chunks/{FUCJM4CG.js → SOTTFVAK.js} +1 -1
  46. package/lib/chunks/{LLGJ3YMR.js → TH4J5VUW.js} +33 -33
  47. package/lib/chunks/{SZKF6VFY.js → UJ6WQ2OD.js} +5 -7
  48. package/lib/chunks/UNBNSCWN.js +20 -0
  49. package/lib/chunks/{FTDJMTRX.js → UR72TK6I.js} +1 -1
  50. package/lib/chunks/{FIIFOPJG.js → XY2QUSMZ.js} +1 -1
  51. package/lib/chunks/{QZBHV7SD.js → XZM2ITNF.js} +1 -1
  52. package/lib/chunks/{L24E6ZRY.js → YOV4L7V6.js} +1 -1
  53. package/lib/chunks/{CKJYJBJ6.js → Z2BI77LK.js} +1 -1
  54. package/lib/eject-assets/AGENTS.md +1 -0
  55. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  56. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  57. package/lib/eject-assets/generators/cli/index.ts +2 -2
  58. package/lib/eject-assets/generators/cli/render.ts +3 -6
  59. package/lib/eject-assets/generators/go/client.ts +1 -1
  60. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  61. package/lib/eject-assets/generators/go/index.ts +2 -2
  62. package/lib/eject-assets/generators/go/models.ts +1 -1
  63. package/lib/eject-assets/generators/go/naming.ts +1 -1
  64. package/lib/eject-assets/generators/go/operations.ts +1 -1
  65. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  66. package/lib/eject-assets/generators/go/types.ts +1 -1
  67. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  68. package/lib/eject-assets/generators/mock/index.ts +2 -2
  69. package/lib/eject-assets/generators/mock/render.ts +1 -1
  70. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  71. package/lib/eject-assets/generators/mock/values.ts +1 -1
  72. package/lib/eject-assets/generators/php/client.ts +1 -1
  73. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  74. package/lib/eject-assets/generators/php/index.ts +2 -2
  75. package/lib/eject-assets/generators/php/models.ts +1 -1
  76. package/lib/eject-assets/generators/php/naming.ts +1 -1
  77. package/lib/eject-assets/generators/php/operations.ts +1 -1
  78. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  79. package/lib/eject-assets/generators/php/types.ts +1 -1
  80. package/lib/eject-assets/generators/python/client.ts +1 -1
  81. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  82. package/lib/eject-assets/generators/python/index.ts +2 -2
  83. package/lib/eject-assets/generators/python/models.ts +1 -1
  84. package/lib/eject-assets/generators/python/naming.ts +1 -1
  85. package/lib/eject-assets/generators/python/operations.ts +1 -1
  86. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  87. package/lib/eject-assets/generators/python/types.ts +1 -1
  88. package/lib/eject-assets/generators/swr/index.ts +2 -2
  89. package/lib/eject-assets/generators/swr/render.ts +1 -1
  90. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  91. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  92. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  93. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  94. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  95. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  96. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  97. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  98. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  99. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  100. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  101. package/lib/eject-assets/generators/typescript/operations.ts +3 -5
  102. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  103. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  104. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  105. package/lib/eject-assets/generators/zod/index.ts +2 -2
  106. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  107. package/lib/eject-assets/skills/client-generators/SKILL.md +1 -0
  108. package/lib/index.js +9 -9
  109. package/package.json +2 -2
  110. package/lib/chunks/4JE7GYQB.js +0 -7
  111. package/lib/chunks/5KMAESVG.js +0 -78
  112. package/lib/chunks/AM6FT7EB.js +0 -9
  113. package/lib/chunks/BYIMEGON.js +0 -20
  114. package/lib/chunks/ENDHNS6Y.js +0 -7
  115. package/lib/chunks/IPVLUS43.js +0 -30
  116. package/lib/chunks/JH4AUZLH.js +0 -11
  117. package/lib/chunks/XFRPQNF6.js +0 -20
  118. package/lib/chunks/ZDNSHHXT.js +0 -7
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as se}from"./BXI4SF2U.js";import{ea as M,j as L,l as $,la as W,na as m,o as j,p as B}from"./L2EEGRZN.js";import{e as ne}from"./RFWIIJFG.js";var S=ne(se(),1);function b(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function H(o){let t=process.env.NO_PROXY||process.env.no_proxy;if(!t)return!1;let e=t.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(e.length===0)return!1;let r;try{r=new URL(o).hostname.toLowerCase()}catch{return!1}return e.some(s=>!!(s==="*"||r===s||s.startsWith(".")&&r.endsWith(s)||!s.startsWith(".")&&r.endsWith("."+s)))}var q=async(o,{timeout:t,...e}={})=>{let r=b(),s=r&&!H(o),n,i=t?{connect:{timeout:t}}:{};return s?n=new S.ProxyAgent({uri:r,...i}):t&&(n=new S.Agent(i)),await fetch(o,{signal:t?AbortSignal.timeout(t):void 0,...e,dispatcher:n})};var oe=/^[\x21-\x7e]+( [\x21-\x7e]+)*$/;function Y(){let o=process.env.REDOCLY_ENVIRONMENT?.trim();return o&&oe.test(o)?o:void 0}var u=class extends Error{status;constructor(t,e){super(t),this.status=e}},y=class{command;version;sunsetWarnings=[];constructor(t,e="2.0"){this.command=t,this.version=e}async request(t,e){let r=Y(),s={...e.headers,"user-agent":`redocly-cli/${this.version} ${this.command}${r?` ${r}`:""}`};try{let n=await q(t,{...e,headers:s});return this.collectSunsetWarning(n),n}catch(n){let i="Failed to fetch.";throw n.cause&&(i+=` Caused by ${n.cause.message||n.cause.name}.`),(n.code||n.cause?.code)&&(i+=` Code: ${n.code||n.cause?.code}`),new Error(i)}}collectSunsetWarning(t){let e=this.getSunsetDate(t);if(!e)return;let r=new Date(e);e>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(t){let{headers:e}=t;if(!e)return;let r=e.get("sunset")||e.get("Sunset");if(r)return Date.parse(r)}},A=class{client;domain;apiKey;constructor(t,e,r){this.client=t,this.domain=e,this.apiKey=r}async getParsedResponse(t){let e=await t.json();if(t.ok)return e;throw new u(`${e.title||t.statusText||"Unknown error"}.`,t.status)}async getDefaultBranch(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/source`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return(await this.getParsedResponse(r)).branchName}catch(r){let s=`Failed to fetch default branch. ${r.message}`;throw r instanceof u?new u(s,r.status):new Error(s)}}async upsert(t,e,r){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/remotes`,{timeout:6e3,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({mountPath:r.mountPath,mountBranchName:r.mountBranchName,type:"CICD",autoMerge:!0})});return await this.getParsedResponse(s)}catch(s){let n=`Failed to upsert remote. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}async push(t,e,r,s){let n=new globalThis.FormData;n.append("remoteId",r.remoteId),n.append("commit[message]",r.commit.message),n.append("commit[author][name]",r.commit.author.name),n.append("commit[author][email]",r.commit.author.email),n.append("commit[branchName]",r.commit.branchName),r.commit.url&&n.append("commit[url]",r.commit.url),r.commit.namespace&&n.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&n.append("commit[sha]",r.commit.sha),r.commit.repository&&n.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&n.append("commit[createdAt]",r.commit.createdAt);for(let i of s){let a=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await ie(i.stream)]);n.append(`files[${i.path}]`,a,i.path)}r.isMainBranch&&n.append("isMainBranch","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes`,{method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`},body:n});return await this.getParsedResponse(i)}catch(i){let a=`Failed to push. ${i.message}`;throw i instanceof u?new u(a,i.status):new Error(a)}}async getPush({organizationId:t,projectId:e,pushId:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes/${r}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get push status. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}},p=class{apiClient;remotes;constructor({domain:t,apiKey:e,command:r,version:s}){this.apiClient=new y(r,s),this.remotes=new A(this.apiClient,t,e)}getSunsetWarning(){return V(this.apiClient.sunsetWarnings)}};function V(o){let[t]=[...o].sort((e,r)=>e.isSunsetExpired!==r.isSunsetExpired?e.isSunsetExpired?-1:1:e.sunsetDate>r.sunsetDate?1:-1);return t}async function ie(o){let t=[];for await(let e of o)t.push(e);return Buffer.concat(t)}function ae(){if(process.env.REDOCLY_AUTHORIZATION)return process.env.REDOCLY_AUTHORIZATION;throw new Error("No api key provided, please use environment variable REDOCLY_AUTHORIZATION.")}var v={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function ce(){return process.env.REDOCLY_DOMAIN||v.us}var z=ue((o,t)=>{try{let e=t||o?.resolvedConfig.residency;return le(e)?v[e]:e?new URL(e).origin:o?.resolvedConfig.scorecard?.fromProjectUrl?new URL(o.resolvedConfig.scorecard.fromProjectUrl).origin:v.us}catch{throw new T}});function N(o){try{z(void 0,o)}catch{return!1}return!0}function ue(o){return(...t)=>{let e=o(...t);if(!e.startsWith("https://"))throw new T;return e}}var T=class extends Error{constructor(){super("Invalid Reunite URL")}};function le(o){return typeof o=="string"&&o in v}import{Buffer as I}from"node:buffer";import _ from"node:crypto";import{mkdirSync as he,existsSync as G,writeFileSync as de,readFileSync as me,rmSync as pe}from"node:fs";import{homedir as fe}from"node:os";import X from"node:path";import*as K from"node:child_process";var f=class{baseUrl;apiClient;clientName="redocly-cli";constructor(t,e){this.baseUrl=t,this.apiClient=new y("login",e)}async run(t){let e=await this.getDeviceCode();t?.({verificationUri:e.verificationUri,verificationUriComplete:e.verificationUriComplete,userCode:e.userCode}),this.openBrowser(e.verificationUriComplete);let r=await this.pollingAccessToken(e.deviceCode,e.interval,e.expiresIn);return this.withResidency(r)}openBrowser(t){if(!/^https?:\/\//.test(t))return;let[e,r]=process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:process.platform==="darwin"?["open",[t]]:["xdg-open",[t]];K.spawn(e,r,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}async verifyToken(t){try{return!!(await this.sendRequest("/session","GET",void 0,{Cookie:`accessToken=${t};`})).user}catch{return!1}}async verifyApiKey(t){try{return!!(await this.sendRequest("/api-keys-verify","POST",{apiKey:t})).success}catch{return!1}}async refreshToken(t){let e=await this.sendRequest("/device-rotate-token","POST",{grant_type:"refresh_token",client_name:this.clientName,refresh_token:t});if(!e.access_token)throw new Error("Failed to refresh token");return this.withResidency({access_token:e.access_token,refresh_token:e.refresh_token,expires_in:e.expires_in})}async pollingAccessToken(t,e,r){return new Promise((s,n)=>{let i=setInterval(async()=>{let c=await this.getAccessToken(t);c.access_token&&(clearInterval(i),clearTimeout(a),s(c)),c.error&&c.error!=="authorization_pending"&&(clearInterval(i),clearTimeout(a),n(c.error_description))},e*1e3),a=setTimeout(async()=>{clearInterval(i),clearTimeout(a),n("Authorization has expired. Please try again.")},r*1e3)})}async getAccessToken(t){return await this.sendRequest("/device-token","POST",{client_name:this.clientName,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})}async getDeviceCode(){let{device_code:t,user_code:e,verification_uri:r,verification_uri_complete:s,interval:n=10,expires_in:i=300}=await this.sendRequest("/device-authorize","POST",{client_name:this.clientName});return{deviceCode:t,userCode:e,verificationUri:r,verificationUriComplete:s,interval:n,expiresIn:i}}async sendRequest(t,e="GET",r=void 0,s={}){let n=`${this.baseUrl}/api${t}`,i=await this.apiClient.request(n,{body:r&&JSON.stringify(r),method:e,headers:{"Content-Type":"application/json",...s},timeout:6e3});return i.status===204?{success:!0}:await i.json()}withResidency(t){return{...t,residency:this.baseUrl}}};var ge="4618dbc9-8aed-4e27-aaf0-225f4603e5a4",J="aes-256-cbc",D=class{version;credentialsFolderPath;credentialsFilePath;credentialsFileName;key;iv;constructor(t){this.version=t;let e=fe();this.credentialsFolderPath=X.join(e,".redocly"),this.credentialsFileName="credentials",this.credentialsFilePath=X.join(this.credentialsFolderPath,this.credentialsFileName),this.key=_.createHash("sha256").update(`${this.credentialsFolderPath}${ge}`).digest(),this.iv=_.createHash("md5").update(this.credentialsFolderPath).digest(),he(this.credentialsFolderPath,{recursive:!0})}async login(t,e){let s=await new f(t,this.version).run(e);if(!s)throw new Error("Failed to login. No credentials received.");await this.saveCredentials(s)}async logout(){try{this.removeCredentials()}catch{}}async isAuthorized(t,e){return e?new f(t,this.version).verifyApiKey(e):!!await this.getAccessToken(t)}getAccessToken=async t=>{let e=new f(t,this.version),r=await this.readCredentials();if(!r||!N(t)||r.residency&&r.residency!==t)return null;if(await e.verifyToken(r.access_token))return r.access_token;try{let n=await e.refreshToken(r.refresh_token);return await this.saveCredentials(n),n.access_token}catch{return null}};async saveCredentials(t){try{let e=this.encryptCredentials(t);de(this.credentialsFilePath,e,"utf8")}catch(e){throw new Error(`Failed to save credentials: ${e.message}`)}}async readCredentials(){if(!G(this.credentialsFilePath))return null;try{let t=me(this.credentialsFilePath,"utf8");return this.decryptCredentials(t)}catch{return null}}async removeCredentials(){G(this.credentialsFilePath)&&pe(this.credentialsFilePath)}encryptCredentials(t){let e=_.createCipheriv(J,this.key,this.iv);return I.concat([e.update(JSON.stringify(t),"utf8"),e.final()]).toString("hex")}decryptCredentials(t){let e=_.createDecipheriv(J,this.key,this.iv),r=I.concat([e.update(I.from(t,"hex")),e.final()]);return JSON.parse(r.toString("utf8"))}};import*as g from"node:fs";import*as d from"node:path";async function we({domain:o,apiKey:t,organization:e,project:r,mountPath:s,files:n,defaultBranch:i,commit:a,version:c,onUploadStart:x,onSunsetWarning:C}){let h=new p({domain:o,apiKey:t,command:"push",version:c});try{let w=await h.remotes.getDefaultBranch(e,r),P=await h.remotes.upsert(e,r,{mountBranchName:w,mountPath:s});x?.(P);let{id:E}=await h.remotes.push(e,r,{remoteId:P.id,commit:a,isMainBranch:i===a.branchName},n.map(l=>({path:j(l.name),stream:g.createReadStream(l.path)})));return{pushId:E}}finally{let w=h.getSunsetWarning();w&&C?.(w)}}function ye(o,t){let e={};for(let s of o)if(g.statSync(s).isDirectory()){let n=s;Z(n,[]).forEach(a=>r(a,n))}else r(s,d.dirname(s));function r(s,n){let i=d.relative(n,s);e[i]&&t?.(e[i],s),e[i]=s}return Object.entries(e).map(([s,n])=>({name:s,path:d.resolve(n)}))}function Z(o,t){let e=g.readdirSync(o);for(let r of e){let s=d.join(o,r);g.statSync(s).isDirectory()?t=Z(s,t):t.push(s)}return t}async function Q({operation:o,condition:t,onConditionNotMet:e,startTime:r=Date.now(),retryTimeoutMs:s=6e5,retryIntervalMs:n=5e3}){async function i(){let a=await o();if(t(a))return a;if(Date.now()-r>s)throw new Error("Timeout exceeded.");return await e?.(a),await L(n),i()}return i()}var ve=1200,Te=5e3,xe=["pending","running"];async function Ce(o){let t=ee(o);try{return await re(t,o)}finally{te(t,o)}}async function Pe({buildType:o,maxExecutionTime:t=ve,retryIntervalMs:e=Te,startTime:r=Date.now(),onRetry:s,...n}){let i=ee(n);try{return await Q({operation:()=>re(i,n),condition:a=>!xe.includes(a.status[o].deploy.status),onConditionNotMet:s,startTime:r,retryTimeoutMs:t*1e3,retryIntervalMs:e})}finally{te(i,n)}}function ee({domain:o,apiKey:t,version:e}){return new p({domain:o,apiKey:t,command:"push-status",version:e})}function te(o,{onSunsetWarning:t}){let e=o.getSunsetWarning();e&&t?.(e)}function re(o,{organization:t,project:e,pushId:r}){return o.remotes.getPush({organizationId:t,projectId:e,pushId:r})}async function Ee({projectUrl:o,auth:t,isApiKey:e=!1,onDebug:r}){let s=Re(o);if(!s)throw new m(`Invalid project URL format: ${o}`);try{let n=await Se({...s,auth:t,isApiKey:e,onDebug:r}),i=n.config.scorecardClassic||n.config.scorecard;if(!i)throw new Error("No scorecard configuration found.");let a=n.config.pluginsUrl,c=a?await _e(a,r):void 0;return{scorecard:i,plugins:c,pluginsUrl:a}}catch(n){throw new m(n instanceof Error?n.message:String(n))}}function Re(o){let t=new URL(o),e=t.pathname.match(/\/org\/(?<orgSlug>[^/]+)\/project\/(?<projectSlug>[^/]+)/);if(!e?.groups)return;let{orgSlug:r,projectSlug:s}=e.groups;return{residency:t.origin,orgSlug:r,projectSlug:s}}async function Se({residency:o,orgSlug:t,projectSlug:e,auth:r,isApiKey:s,onDebug:n}){let i=new URL(`${o}/api/orgs/${t}/projects/${e}`),a=await fetch(i,{headers:Fe(r,s)});if(n?.(`Project fetch response status: ${a.status}`),a.status===401||a.status===403)throw n?.(`Authentication failed with status ${a.status}.`),n?.("Check that your credentials are valid and have the necessary permissions."),new Error(`Unauthorized access to project: ${e}. Please check your credentials.`);if(a.status!==200)throw new Error(`Failed to fetch project: ${e}. Status: ${a.status}`);return n?.("Successfully received project configuration."),a.json()}async function _e(o,t){t?.(`Fetching plugins from: ${o}`);try{let e=await fetch(o);if(t?.(`Plugins fetch response status: ${e.status}`),e.status!==200){t?.("Failed to fetch plugins");return}return e.text()}catch(e){t?.(`Error fetching plugins: ${e instanceof Error?e.message:String(e)}`);return}}function Fe(o,t){return t?{Authorization:`Bearer ${o}`}:{Cookie:`accessToken=${o}`}}async function O(o,t,e=[],r=[],s){let n={};for(let i of e){let a={[i.name]:{root:o,rules:t}},c=await M({apis:a,...i,plugins:r},{configPath:s});n[i.name]=c.forAlias(i.name)}return n}function k(o,t){if(o){for(let e of o)if(Object.entries(e.where?.metadata||{}).every(([s,n])=>$e(s,n,t)))return e}}function $e(o,t,e){if(t.match(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}Z)?\/(\d{4}-\d{2}-\d{2})?$/)){if(!e[o])return!1;let[r,s]=t.split("/"),n=new Date(e[o]);return!(n<new Date(r)||s&&n>new Date(s))}else if(t.match(/^\/.*\//)){if(!e[o])return!1;try{return B(t).test(e[o])}catch{throw new m(`Invalid regex in scorecard target "${o}": ${t}`)}}return e[o]===t}import{pathToFileURL as Ue}from"node:url";async function Ae(o,t){if(!o)return[];let e=Ue(t??process.cwd()).href+"/",r=o.replaceAll("__redocly_dirname",`"${e}"`);return(await import(`data:text/javascript;base64,${btoa(r)}`)).default.map(i=>i())}var Ne=".redocly.com";function Ie(o){try{return new URL(o).hostname.toLowerCase().endsWith(Ne)}catch{return!1}}async function De({apiPath:o,document:t,externalRefResolver:e,scorecardConfig:r,configPath:s,plugins:n=[],targetLevel:i,metadata:a={},onDebug:c}){let x=[],C=new Map,h=r.levels||[];if(i&&!h.some(l=>l.name===i))throw new m(`Target level "${i}" not found in the scorecard configuration levels.
8
+ `);let w=k(r.targets,a)?.rules,P=await O(o,w,h,n,s||"");for(let l of h){c?.(`
9
+ Validating level: "${l.name}"`),n.length>0&&c?.(`Using ${n.length} ${$("plugin",n.length)} for this level.`),c?.("Linting document against level rules...");let R=(await W({document:t,externalRefResolver:e,config:P[l.name]})).filter(({ignored:F})=>!F).map(F=>({...F,scorecardLevel:l.name}));c?.(`Found ${R.length} ${$("problem",R.length)} for level "${l.name}".`),C.set(l.name,R),x.push(...R)}let E=Oe(C,h,i);return{problems:x,achievedLevel:E,targetLevelAchieved:i?E===i:!0}}function Oe(o,t,e){let r=null;for(let s of t){if((o.get(s.name)||[]).some(a=>a.severity==="error"))return r||"Non Conformant";if(r=s.name,e&&s.name===e)return s.name}return r||"Non Conformant"}export{u as a,y as b,p as c,V as d,ae as e,v as f,ce as g,z as h,N as i,T as j,f as k,D as l,we as m,ye as n,Ce as o,Pe as p,Ee as q,O as r,k as s,Ae as t,Ie as u,De as v};
@@ -4,11 +4,11 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./IPVLUS43.js";import{b,g as T}from"./JH4AUZLH.js";import{a as f,c as R,d as v,e as k}from"./UAEEHSSK.js";import{d as I,f as N,h as P,i as j,m as C}from"./LD5MEXEL.js";import{join as Y}from"node:path";var y="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function $(e){return e.filter(t=>t.length>0).join(`
7
+ import{b as S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./B6JQC3AM.js";import{g as b,i as T}from"./KPWZVETN.js";import{a as f,c as R,d as v,e as k}from"./DFVJG4OO.js";import{d as I,f as N,h as P,i as j,m as C}from"./LD5MEXEL.js";import{join as Y}from"node:path";var y="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function $(e){return e.filter(t=>t.length>0).join(`
8
8
 
9
9
  `)+`
10
10
  `}function O(e){let t=["/**",` * ${j(`${e.title} (v${e.version})`)}`];if(e.description)for(let n of C(j(e.description)))t.push(` * ${n}`.replace(/ +$/,""));return t.push(" */"),t.join(`
11
- `)}function x(e){let t=new Set(k),n=new Map;for(let r of f(e.services))n.set(r.name,N(r.name,t));return n}function Z(e,t,n,r,s=[],o="grouped"){let i=[...e.pathParams,...e.queryParams,...e.headerParams,...e.cookieParams].map(c=>({name:c.name,in:c.in,...c.style!==void 0?{style:c.style}:{},...c.explode!==void 0?{explode:c.explode}:{},...c.allowReserved!==void 0?{allowReserved:c.allowReserved}:{}})),p=T(e,{securitySchemes:t}),m=e.sse!==void 0?"sse":M(e.successResponses,n).kind,u=E(e.successResponseHeaders,s);return{id:e.specName??e.name,method:e.method.toUpperCase(),path:e.path,...e.tags.length>0?{tags:e.tags}:{},...i.length>0?{params:i}:{},...e.requestBody?{body:{contentType:e.requestBody.contentType,...S(e.requestBody)?{multipart:!0}:{}}}:{},...m!=="json"?{responseKind:m}:{},...e.sse===void 0?{}:{sseDataKind:e.sse.dataKind},...p.length>0?{security:p}:{},...u===void 0?{}:{responseHeaders:u},...r?.has(e.name)?{pagination:r.get(e.name).spec}:{},...o==="flat"&&"collisions"in q(e,s)?{argsStyle:"grouped"}:{}}}function L(e,t,n,r,s="grouped"){let o=f(e.services);if(o.length===0)return"";let i=o.map((a,m)=>{let u=P(Z(a,e.securitySchemes,n,r,e.schemas,s));return` ${t.get(a.name)}: ${u}${m===o.length-1?"":","}`}),p=[[...w(`The wire-shape descriptor for every operation, keyed by operationId \u2014 the data the
11
+ `)}function x(e){let t=new Set(k),n=new Map;for(let r of f(e.services))n.set(r.name,N(r.name,t));return n}function Z(e,t,n,r,s=[],o="grouped"){let i=[...e.pathParams,...e.queryParams,...e.headerParams,...e.cookieParams].map(c=>({name:c.name,in:c.in,...c.style!==void 0?{style:c.style}:{},...c.explode!==void 0?{explode:c.explode}:{},...c.allowReserved!==void 0?{allowReserved:c.allowReserved}:{}})),p=b(e,{securitySchemes:t}),m=e.sse!==void 0?"sse":M(e.successResponses,n).kind,u=E(e.successResponseHeaders,s);return{id:e.specName??e.name,method:e.method.toUpperCase(),path:e.path,...e.tags.length>0?{tags:e.tags}:{},...i.length>0?{params:i}:{},...e.requestBody?{body:{contentType:e.requestBody.contentType,...S(e.requestBody)?{multipart:!0}:{}}}:{},...m!=="json"?{responseKind:m}:{},...e.sse===void 0?{}:{sseDataKind:e.sse.dataKind},...p.length>0?{security:p}:{},...u===void 0?{}:{responseHeaders:u},...r?.has(e.name)?{pagination:r.get(e.name).spec}:{},...o==="flat"&&"collisions"in q(e,s)?{argsStyle:"grouped"}:{}}}function L(e,t,n,r,s="grouped"){let o=f(e.services);if(o.length===0)return"";let i=o.map((a,m)=>{let u=P(Z(a,e.securitySchemes,n,r,e.schemas,s));return` ${t.get(a.name)}: ${u}${m===o.length-1?"":","}`}),p=[[...w(`The wire-shape descriptor for every operation, keyed by operationId \u2014 the data the
12
12
  runtime routes requests by. Also minification-safe static metadata (method, path,
13
13
  tags) for cache keys, tracing span names, and request logging.`,void 0,""),"export const OPERATIONS = {",...i,"} as const satisfies Record<string, OperationDescriptor>;"].join(`
14
14
  `),'export type OperationId = (typeof OPERATIONS)[keyof typeof OPERATIONS]["id"];','export type OperationPath = (typeof OPERATIONS)[keyof typeof OPERATIONS]["path"];'];return o.some(a=>a.tags.length>0)&&p.push(`export type OperationTag = Extract<(typeof OPERATIONS)[keyof typeof OPERATIONS], {
@@ -61,7 +61,7 @@ ${r.trim()}
61
61
  const __redoclySetup: { config?: ClientConfig; middleware?: Middleware[] } = ${e.setup};
62
62
  `+u:u}function ae(e,t){let n=["export const { configure, use } = client;"];if(e.length===0)return n.join(`
63
63
  `);let r=e.map(s=>t.get(s.name)).join(", ");return n.push(`export const { ${r} } = client;`),n.join(`
64
- `)}var Me=({model:e,output:t,outputMode:n,emit:r})=>{let s=V(e,r).map(({name:o,content:i})=>({path:Y(t.dir,"runtime",o),content:i}));if(n==="split"){let{dir:o,stem:i}=t,{entry:p,schemas:a}=W(e,r,i);return[...a===void 0?[]:[{path:Y(o,`${i}.schemas.ts`),content:a}],{path:t.path,content:p},...s]}return[{path:t.path,content:K(e,r)},...s]},qe=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".typescript.md"),content:b(e,{title:`${e.title} TypeScript client reference`,frontmatter:n.docsFrontmatter===!0,language:{name:"typescript",label:"TypeScript",fence:"typescript",requires:"The client has no dependencies."},sample:s=>ce(s,{model:e,emit:n,outputPath:t.path}),paginated:new Set(r?.keys()??[])})}];function ce(e,t){let n=x(t.model).get(e.name)??e.name,s=`./${t.outputPath.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")}.${t.emit.importExt??"js"}`,o=e.queryParams.filter(c=>c.required),i=t.emit.argsStyle==="flat",p=e.pathParams.map(c=>`${c.name}: '<${c.name}>'`),a=o.map(c=>`${c.name}: /* \u2026 */`),m=i?[...p,...a,...e.requestBody?["/* body properties */"]:[]]:[...p.length>0?[`path: { ${p.join(", ")} }`]:[],...a.length>0?[`query: { ${a.join(", ")} }`]:[],...e.requestBody?["body: { /* \u2026 */ }"]:[]],u=m.length>0?[`{ ${m.join(", ")} }`]:[];return{lang:"typescript",label:"TypeScript SDK",source:`import { ${n} } from '${s}';
64
+ `)}var Me=({model:e,output:t,outputMode:n,emit:r})=>{let s=V(e,r).map(({name:o,content:i})=>({path:Y(t.dir,"runtime",o),content:i}));if(n==="split"){let{dir:o,stem:i}=t,{entry:p,schemas:a}=W(e,r,i);return[...a===void 0?[]:[{path:Y(o,`${i}.schemas.ts`),content:a}],{path:t.path,content:p},...s]}return[{path:t.path,content:K(e,r)},...s]},qe=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".typescript.md"),content:T(e,{title:`${e.title} TypeScript client reference`,frontmatter:n.docsFrontmatter===!0,language:{name:"typescript",label:"TypeScript",fence:"typescript",requires:"The client has no dependencies."},sample:s=>ce(s,{model:e,emit:n,outputPath:t.path}),paginated:new Set(r?.keys()??[])})}];function ce(e,t){let n=x(t.model).get(e.name)??e.name,s=`./${t.outputPath.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")}.${t.emit.importExt??"js"}`,o=e.queryParams.filter(c=>c.required),i=t.emit.argsStyle==="flat",p=e.pathParams.map(c=>`${c.name}: '<${c.name}>'`),a=o.map(c=>`${c.name}: /* \u2026 */`),m=i?[...p,...a,...e.requestBody?["/* body properties */"]:[]]:[...p.length>0?[`path: { ${p.join(", ")} }`]:[],...a.length>0?[`query: { ${a.join(", ")} }`]:[],...e.requestBody?["body: { /* \u2026 */ }"]:[]],u=m.length>0?[`{ ${m.join(", ")} }`]:[];return{lang:"typescript",label:"TypeScript SDK",source:`import { ${n} } from '${s}';
65
65
 
66
66
  const result = await ${n}(${u.join(", ")});
67
67
  `}}export{Me as a,qe as b,ce as c};
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as f,m as u}from"./UW4UC7ZI.js";function m(e,t){let n=t??{},i=e.specName??e.name;if(Array.isArray(n.exclude)&&n.exclude.includes(i))return;let r=(n.operations??{})[i]??e.paginationExtension;if(r===void 0&&typeof n.style=="string"){let{exclude:c,operations:B,...l}=n,g=l.style==="cursor"?l.cursorParam:l.offsetParam;(l.style==="link"?e.successResponseHeaders?.some(p=>p.name==="link")===!0:typeof g=="string"&&e.queryParams.some(p=>p.name===g))&&(r=l)}if(r===void 0||typeof r.style!="string")return;let s=r.style==="cursor"?r.cursorParam:r.offsetParam;return{style:r.style,...typeof s=="string"?{param:s}:{},...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{},...typeof r.hasMore=="string"?{hasMore:r.hasMore}:{},...typeof r.limitParam=="string"?{limitParam:r.limitParam}:{},...typeof r.items=="string"?{items:r.items}:{}}}function h(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function x(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function k(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}var R=["application/octet-stream","application/pdf","image/","audio/","video/","font/","application/x-font-","application/zip","application/x-zip-compressed","application/gzip","application/x-gzip","application/x-bzip2","application/x-tar","application/x-rar-compressed","application/x-7z-compressed","application/vnd.openxmlformats-officedocument","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/msword","application/x-shockwave-flash"];function d(e){let t=e.split(";")[0].trim().toLowerCase();return R.some(n=>t.startsWith(n))}function b(e){let t=new Set(e.variables.map(s=>s.name)),n=[],i="",a=e.url,r=/\{([^{}]+)\}/;for(let s=r.exec(a);s!==null;s=r.exec(a))i+=a.slice(0,s.index),t.has(s[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:s[1]})):i+=s[0],a=a.slice(s.index+s[0].length);return i+=a,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function S(e,t){return e.security.map(n=>n.flatMap(i=>{let a=t.securitySchemes.find(r=>r.key===i);return a===void 0?[]:a.kind==="bearer"||a.kind==="basic"?[{scheme:i,kind:a.kind}]:a.kind==="apiKeyHeader"?[{scheme:i,kind:"apiKey",name:a.headerName,in:"header"}]:a.kind==="apiKeyQuery"?[{scheme:i,kind:"apiKey",name:a.paramName,in:"query"}]:[{scheme:i,kind:"apiKey",name:a.cookieName,in:"cookie"}]})).filter(n=>n.length>0)}function $(e,t,n){if(e===void 0||t===void 0)return;let i=u(e,t,n);return i?.kind==="array"?i.items:void 0}function y(e){return(e??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function o(e){switch(e.kind){case"ref":return e.name;case"omit":return e.base;case"scalar":return e.scalar;case"array":return`array of ${o(e.items)}`;case"record":return`map of ${o(e.value)}`;case"enum":{let t=e.values.map(String),n=t.slice(0,6).join(", ");return t.length>6?`enum: ${n}, and ${t.length-6} more`:`enum: ${n}`}case"literal":return String(e.value);case"union":return e.members.map(o).join(" or ");case"intersection":return e.members.map(o).join(" and ");case"object":return"object";case"null":return"null";case"unknown":return"any"}}function P(e){return e.successResponses.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.successResponses.some(t=>d(t.contentType))}function T(e,t){e.line("| Parameter | In | Type | Required | Description |"),e.line("| --------- | -- | ---- | -------- | ----------- |");for(let n of t)e.line(`| \`${n.name}\` | ${n.in} | ${y(o(n.schema))} | ${n.required?"yes":"no"} | ${y(n.description)} |`);e.blank()}function C(e,t,n){e.line(`### \`${t.specName??t.name}\``),e.blank(),t.summary!==void 0&&(e.line(y(t.summary)),e.blank()),e.line(`\`${t.method.toUpperCase()} ${t.path}\``),e.blank();let i=n.sample(t);if(i!==void 0){e.line("```"+n.language.fence);for(let c of i.source.replace(/\n+$/,"").split(`
8
+ `))e.line(c);e.line("```"),e.blank()}let a=[...t.pathParams,...t.queryParams,...t.headerParams];a.length>0&&T(e,a),t.requestBody!==void 0&&e.line(`Body: \`${t.requestBody.contentType}\`${t.requestBody.required?", required":", optional"}, of type ${o(t.requestBody.schema)}.`);let r=t.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${o(r.schema)}.`),(n.paginated!==void 0?n.paginated.has(t.name):m(t,n.pagination)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),t.successResponses.some(c=>c.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),P(t)&&e.line("This operation returns binary content."),e.blank()}function v(e,t){let n=new f;if(t.frontmatter&&(n.line("---"),n.line(`title: ${t.title}`),n.line("---"),n.blank()),n.line(`# ${t.title}`),n.blank(),n.line(`Generated reference for the ${t.language.label} SDK, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line(t.language.requires),n.blank(),n.line("## Authentication"),n.blank(),e.securitySchemes.length===0)n.line("The description declares no security schemes.");else{n.line("The description declares these schemes, which you pass to the client:"),n.blank(),n.line("| Scheme | Kind | Sent as |"),n.line("| ------ | ---- | ------- |");for(let r of e.securitySchemes){let s=r.kind==="bearer"?"`Authorization: Bearer <token>`":r.kind==="basic"?"`Authorization: Basic <base64>`":r.kind==="apiKeyHeader"?`the \`${r.headerName}\` header`:r.kind==="apiKeyQuery"?`the \`${r.paramName}\` query parameter`:`the \`${r.cookieName}\` cookie`;n.line(`| \`${r.key}\` | ${r.kind} | ${s} |`)}}n.blank();let i=e.services.flatMap(r=>r.operations),a=[...new Set(i.map(r=>r.tags[0]))];for(let r of a){n.line(r===void 0?"## Operations":`## ${r}`),n.blank();for(let s of i.filter(c=>c.tags[0]===r))C(n,s,t)}return n.toString().replace(/\n{3,}/g,`
9
+
10
+ `).trimEnd()+`
11
+ `}var ee=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function E(e){return e}function w(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function A(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function q(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function de(e){return e}async function ke(e){return(await import("./PZLKJXIF.js")).generateClient(e)}export{m as a,h as b,x as c,k as d,d as e,b as f,S as g,$ as h,v as i,ee as j,E as k,w as l,A as m,q as n,de as o,ke as p};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as x,b as y,c as R,d as u}from"./23QBFBKB.js";import{a as v}from"./FTDJMTRX.js";import{c as f,d as g}from"./FUCJM4CG.js";import{X as a,na as m,oa as w}from"./RW2ESAIF.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as S,writeFile as O}from"node:fs/promises";import C from"node:path";async function F(e){let i=await g(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity}),r=0,o=0;for(let n of i){let s=await v(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
7
+ import{a as x,b as y,c as R,d as u}from"./32ZHA42N.js";import{a as v}from"./UR72TK6I.js";import{c as f,d as g}from"./SOTTFVAK.js";import{X as a,na as m,oa as w}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as S,writeFile as O}from"node:fs/promises";import C from"node:path";async function F(e){let i=await g(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity}),r=0,o=0;for(let n of i){let s=await v(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
8
8
  `);continue}r+=1;for await(let c of s.parse(n))await t.process({...c,index:o}),o+=1}if(r===0)throw new Error("No supported traffic files found. In auto mode, files must match built-in traffic parser signatures.");if(o===0)throw new Error("No HTTP exchanges were parsed from the provided traffic files.");return t.finalize()}var E=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function T(e){let i=new Set;for(let t of e.operationsByMethod.values())for(let r of t)for(let o of r.servers)i.add(o.rawUrl);return Array.from(i).sort()}function I(e,i,t){let r=e.totalExchanges-e.skippedExchanges;if(r===0&&e.skippedExchanges>0){a.warn(`All ${e.skippedExchanges} exchange(s) were outside the --server "${t}" and were skipped. Check that the server matches the traffic URLs.
9
9
  `);return}if(e.documentedExchanges>0||r===0)return;let o=T(i),n=t?`Check that the --server "${t}" matches the traffic URLs and that the description paths align with the remainder.`:e.hostCompatibleExchanges===r?`The traffic hosts are compatible with the description servers (${o.join(", ")}), so the endpoints are likely undocumented; if they should be documented, check that the description base paths and paths align with the traffic URLs, or use --server to declare the server the traffic was captured against.`:`Check that the traffic host and base path match the description servers (${o.join(", ")}), or use --server to declare the server the traffic was captured against.`;a.warn(`None of the ${r} validated exchange(s) matched a documented operation. ${n}
10
10
  `)}async function $(e,i){let t=f(e);await S(C.dirname(t),{recursive:!0}),await O(t,i,"utf8")}async function q({argv:e,config:i}){let t=f(e.traffic),r=e["traffic-format"],o=e.rules?u(e.rules):void 0,n=e["ignore-headers"]?u(e["ignore-headers"]):void 0,s=e.server;if(s&&e["match-mode"])throw new m("The --server and --match-mode options are mutually exclusive: --match-mode controls how requests are located via the description servers, while --server replaces the description servers with the one the traffic was captured against.");let c=e["match-mode"]??"strict-host",d=f(e.api),p=await R(d,i);if(p.loadedOperations===0)throw new m(`No OpenAPI operations were loaded from: ${d}`);let{runId:k,summary:h,findings:A}=await F({trafficPath:t,format:r,matchMode:c,ignoreCookies:e["ignore-cookies"],ignoreHeaders:n,previewFindingsLimit:e["max-findings"],activeRules:o,openApiIndex:p,server:s,minSeverity:e["min-severity"]});I(h,p,s);let l=x({runId:k,summary:h,findings:A,meta:{specSource:d,trafficPath:t,format:r,matchMode:c,server:s}},{format:e["report-format"],color:E&&e["report-format"]==="pretty"&&!e.output,maxFindings:e["max-findings"]});if(e.output?(await $(e.output,l),a.info(`Drift report written to: ${f(e.output)}
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{l as t}from"./AM6FT7EB.js";import"./BXI4SF2U.js";import{X as o}from"./RW2ESAIF.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
7
+ import{l as t}from"./K2PGWUA3.js";import"./BXI4SF2U.js";import{X as o}from"./L2EEGRZN.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
8
8
  `)}export{i as handleLogout};